Skip to content

Add fall back message for custom error messages - #17

Merged
stloyd merged 1 commit into
KnpLabs:masterfrom
m4tthumphrey:master
Nov 2, 2012
Merged

stloyd merged 1 commit into
KnpLabs:masterfrom
m4tthumphrey:master

Conversation

@m4tthumphrey

Copy link
Copy Markdown
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

stloyd commented Nov 2, 2012

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

stloyd commented Nov 2, 2012

Copy link
Copy Markdown
Contributor

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.

2 participants