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

Add fall back message for custom error messages #17

Merged
merged 1 commit into from Nov 2, 2012

Conversation

m4tthumphrey
Copy link
Contributor

Github also throws custom error messages and the switch doesn't catch it.

[errors] => Array
(
    [0] => Array
    (
        [code] => custom
        [resource] => Repository
        [field] => name
        [message] => name can't be private. You are over your quota.
    )
)

Adding a default fixes this.

Github also throws `custom` error messages and the switch doesn't catch it.

```[errors] => Array
        (
            [0] => Array
                (
                    [code] => custom
                    [resource] => Repository
                    [field] => name
                    [message] => name can't be private. You are over your quota.
                )




        )```

Adding a `default` fixes this.
@stloyd
Copy link
Contributor

stloyd commented Nov 2, 2012

Are you sure that error is thrown with code 422 ? Because only in that case it would be catched... Also an PR do GH API docs would be awesome =)

@m4tthumphrey
Copy link
Contributor Author

I only found it because I received the following as an exception message:

Validation failed: 

Ie no message..

Why do I need to touch the docs for this?

stloyd added a commit that referenced this pull request Nov 2, 2012
Add fall back message for custom error messages
@stloyd stloyd merged commit 22c1d08 into KnpLabs:master Nov 2, 2012
@stloyd
Copy link
Contributor

stloyd commented Nov 2, 2012

Merged then! Thanks!

About PR for GH API docs, it would allow other people to don't miss that there are also such errors, look that only those what I have implemented are listed here: http://developer.github.com/v3/#client-errors

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

Successfully merging this pull request may close these issues.

None yet

2 participants