Never mind. It was simply how I was catching the thrown error.

But is this really an error that should cause an exception?

Everything in the api call was fine, but the file was rejected.

-Adam


On Dec 18, 2011, at 7:58 AM, Adam Meyer wrote:

> MW 1.17
> 
> Im uploading files/images via the api, and it works perfectly.
> 
> When everything goes well, I get back an associative-array, with 'result' 
> equaling 'Success'
>       [result] => Success
>       [imageinfo] => Array
> 
> 
> When there is a warning I get:
>       [result] => Warning
>       [warnings] => warning list array
> 
> 
> But when there is an error, it just spits out a paragraph tag, with the error 
> in it.  like:
>       <p>verification-error: This file did not pass file verification</p>
> 
> 
> I thought the was strange, shouldn't it come back like so?
>       [result] => Error
>       [errors] => error list array
> 
> 
> So how do I check for errors without doing is_array() ?
> 
> 
> Thanks,
> -Adam
> _______________________________________________
> MediaWiki-l mailing list
> [email protected]
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


_______________________________________________
MediaWiki-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Reply via email to