When lawg returns errors, we do it in a specific schema to help the end developer interacting with the API have a guessable and easy to understand error.

Schema

Typically, an error will look like this

{
  "success": false,
  "error": {
    "code": "code",
    "message": "message"
  }
}

Codes

Here is a list of all the error codes that lawg can return.

CodeDescription
rate_limit_exceededYou are being rate limited.
conflictThe resource you are trying to create already exists.
not_foundThe resource you are trying to access does not exist.
bad_requestThe request you sent was malformed.
unauthorizedThe request you sent was unauthorized.
internal_server_errorAn internal server error occurred.
forbiddenYou are not allowed to access this resource.