Skip to content

Instantly share code, notes, and snippets.

@treyhoover
Last active June 12, 2018 18:31
Show Gist options
  • Save treyhoover/f152d5874f72568b56f68259afc7e6f7 to your computer and use it in GitHub Desktop.
Save treyhoover/f152d5874f72568b56f68259afc7e6f7 to your computer and use it in GitHub Desktop.
api error responses
{
error: {
message: "One or more fields appear to be incorrect", // this is the main error message to show users (e.g. at the top of the form)
developer_message: "This is a message for developers to help diagnose the problem", // optional
reasons: [
{
param: "email",
message: "Please enter a valid email address",
},
{
param: "zip",
message: "Please enter a valid zip code",
}
] // can be an empty array
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment