Is it possible to achieve a global policy which can throw different customized error responses based on the type of error thrown?
For eg : for http 500 -> Error message 1
http 404 -> Error message 2
SQL attacks -> Different error
Invalid API key -> Different error
I understand that types of possibles errors will be numerous and would be difficult to categorize each of them. But my idea is to have some custom error responses for certain set of known errors and I can have a generic error for all the other unhandled errors.
Has anyone done similar to this? Really appreciate your suggestions.