Skip to content

Instantly share code, notes, and snippets.

@jmas
Last active April 19, 2018 09:08
Show Gist options
  • Save jmas/32fb1f78b6c3b737ae356a607b544d64 to your computer and use it in GitHub Desktop.
Save jmas/32fb1f78b6c3b737ae356a607b544d64 to your computer and use it in GitHub Desktop.

Error classes

Can't parse

Broken JSON from backend.

General error

Contain errors._general key.

{
  "errors": {
    "_general": {
      "type": "<string>",
      "data": "<any>"
    }
  }
}

Form error

Contain errors._form key.

{
  "errors": {
    "_form": [
      "<string>"
    ]
  }
}

Validation error

Do not contain errors._general and errors._form keys.

{
  "errors": {
    "<string>": "<string>"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment