SSW.Rewards.Mobile
SSW.Rewards.Mobile copied to clipboard
Refactor Api - Review exceptions
Exceptions are slow, we should move away from throwing exceptions inside routes and correctly set status codes instead of the blanket 500.
... exceptions should be used for truly exceptional circumstances.
- Matt G
See: https://www.ssw.com.au/rules/do-you-know-that-you-should-never-throw-an-exception-using-system-exception/ https://www.ssw.com.au/rules/do-you-catch-exceptions-precisely/ https://www.ssw.com.au/rules/do-you-return-the-correct-response-code/ https://www.ssw.com.au/rules/do-you-return-detailed-error-messages/ https://www.ssw.com.au/rules/use-fluent-validation/
- [ ] Ctrl+Shift+F 'throw new'
- [ ] Ensure it is appropriate to throw an exception
- [ ] Ensure exception is handled by the
ApiExceptionFilter