Prerequisites,
We should support exception (API Error) handling in a single point with a standardised way.
For that we have to introduce a global exception handling mechanism and a standard response structure in case of error(s).
Standard exceptions to be handled:
ResourceNotFoundException (relates to 404)
ResourceProcessingException (relates to any 5XX)
Standard exception contains details (as sequence) of the issue occurred.
Framework exception to be handled:
input request validation (relates to 400)
all the validation errors must be put into details at once
ApiError will consists of:
status (int) that represents Http Status Code
message (string) that represents Exception Message
details (List) that represents details of a caught exception
So that,
Disabled controller tests enabled and adjusted accordingly
Exception handling mechanism is tested accordingly
Prerequisites, We should support exception (API Error) handling in a single point with a standardised way. For that we have to introduce a global exception handling mechanism and a standard response structure in case of error(s).
Standard exceptions to be handled:
Framework exception to be handled:
ApiError will consists of:
So that,