robosats icon indicating copy to clipboard operation
robosats copied to clipboard

bad_request should also return an error code

Open jerryfletcher21 opened this issue 1 year ago • 6 comments

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."
}

jerryfletcher21 avatar Jul 13 '24 11:07 jerryfletcher21

is this issue resolved @jerryfletcher21 and @KoalaSat ?

Sansh2356 avatar Mar 28 '25 07:03 Sansh2356

@KoalaSat I can work in this issue if you like

hexlorn avatar Apr 09 '25 21:04 hexlorn

Ey @hexlorn that ks for pinging, it seems I missed @Sansh2356 's request. Let's wait for an answer, if not I'll assign it to you

KoalaSat avatar Apr 10 '25 12:04 KoalaSat

Ey @hexlorn that ks for pinging, it seems I missed @Sansh2356 's request. Let's wait for an answer, if not I'll assign it to you

@KoalaSat you can assign it to @hexlorn i won't be able to do due to some health issue as of now.

Sansh2356 avatar Apr 10 '25 13:04 Sansh2356

Assigned to you @hexlorn thank you

KoalaSat avatar Apr 11 '25 07:04 KoalaSat

@Sansh2356 I hope you get well soon 💪

hexlorn avatar Apr 15 '25 21:04 hexlorn

@KoalaSat Since there has been no activity for the past 4 months, I assumed this issue was available to take. I opened a pull request to fix this. Could you assign me?

aftermath2 avatar Jul 30 '25 07:07 aftermath2