Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsure how to check for error responses #17

Open
jmound opened this issue Feb 20, 2012 · 0 comments
Open

Unsure how to check for error responses #17

jmound opened this issue Feb 20, 2012 · 0 comments

Comments

@jmound
Copy link

jmound commented Feb 20, 2012

What's the best way to check for an error response? If, for example, you make an API call that succeeds, but the request itself is an error, how should I check?

For example, if you try to create a new invoice when there is a pre-existing approved invoice, the entire API call itself "succeeds" but returns an error, which passes the is_object test that is at the bottom of the readme sample.

The return code looks like this:
SimpleXMLElement Object

(
    [ErrorNumber] => 10
    [Type] => ValidationException
    [Message] => A validation exception occurred
    [Elements] => SimpleXMLElement Object
        (
            [DataContractBase] => Array
                (
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant