-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return a 500 status code when there is a genuine error with a payment #357
base: main
Are you sure you want to change the base?
Conversation
returning a 500 status was suggested as a comment on #353 but there would be an annoying side effect. we frequently see P0050 errors in GOV.UK Pay payments and these are generally ignored unless there's a surprising spike. so our monitoring would also pick up lots of 500 response codes and i don't want to get into the habit of ignoring 500s as well! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Unless we do a cloudflare approach and make up a 5XX error. No idea of implications or if this would even be a good idea, but cloudflare added additional 5XX errors for their service. |
hadn't thought of that actually. don't know what downsides there may be. i think our monitoring picks up 5xx equally, but we could tweak that instead i guess. other than "doing the right thing" by web standards, what benefit is there of returning 500? this is for human-facing views rather than an api. alternatively, we could be a little hacky and return 500 only for non P0050 errors? |
I can't think of any downsides to setting our own error status code for P0050 errors and 500 for others. So long as we don't pick one with a standardised meaning yet (from quick research, just avoiding any listed here would be OK) and keep 500 errors as something we still don't ignore. Maybe Sentry can swap 5XX for P0050 errors to a warning or something. Just bike shedding here though really, so long as we don't create a habit of ignoring 500 errors as you warn might happen. |
24fa41d
to
fe0d471
Compare
fe0d471
to
f4ee96b
Compare
@ushkarev @Staberinde any objections to closing this as stale? |
f4ee96b
to
80d4f48
Compare
80d4f48
to
25285db
Compare
25285db
to
b014b35
Compare
b014b35
to
b0625d3
Compare
1c2f1fb
to
159f2ca
Compare
… which can be caused by failing to communicate with the mtp-api or GOV.UK Pay or if GOV.UK Pay themselves experienced an error
159f2ca
to
de0a5b0
Compare
… which can be caused by failing to communicate with the mtp-api or GOV.UK Pay or if GOV.UK Pay themselves experienced an error downstream