-
Notifications
You must be signed in to change notification settings - Fork 20
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
Unhandled server error response handler #41
base: master
Are you sure you want to change the base?
Conversation
Looks neat. I'm however curious as to how other errors (such as validation, not found) and even success responses would be handled. Or is there some benefit in having a single response helper where all the responses are consolidated? |
Yeah I second this. I thought we were going to have |
Nice on @moyo-paystack. We've not caught unhandled exceptions in this PR though. The way i've seen it done in express is pretty straightforward. e.g.
|
@ife-paystack and @opeyemi-paystack I have made changes to the PR based on the discussion here. Please take another look |
Nice @moyo-paystack! What do you think about having a response handler that houses the various response functions? I'm not sure we need each function in a separate file cc @ife-paystack |
Yes, this was exactly my thought too, this method you've implemented would mean we have a response file for each error code? |
@ife-paystack and @opeyemi-paystack I have made changes to the PR based on the discussion here. Please take another look
I could make each response to be in one file. I separated the 4xx and 5xx into separate response methods cos I think it's easier to follow. |
I've moved all the responses to one file |
Tests 👀 @moyo-paystack |
👀 |
Lol @ife-paystack sorry for the non-reply. Will get on to the tests later this evening. |
@moyo-paystack please help resolve conflicts on this and push again |
Changes