Skip to content

bad_request should also return an error code #1383

@jerryfletcher21

Description

@jerryfletcher21

Describe the bug
Every requests made that fails is returned a json response with a string field bad_request specifying the error.
For a client that needs to handle the failed requests it is not comfortable working with these strings.
It also can happen in the backend to change the string of a particular error, and if the client is checking for the previous string it will not catch it.

Expected behavior
Every bad_request should also include an int like error_code, for example like this:

{
    "error_code": 10,
    "bad_request": "The PGP signed cleartext message is not valid."
}

Metadata

Metadata

Assignees

Labels

enhancement 🆙New feature or requestpythonPull requests that update Python code⚡Eligible for Sats ⚡This issue or pull request rewards bitcoin

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions