Error handling middleware for Express applications.
This middleware is designed to handle errors thrown during request processing.
It checks whether the error is an instance of ClientError or ServerError
and responds accordingly. If the error is not recognized, it defaults to
creating a ServerError instance to provide a standardized error response.
Error handling middleware for Express applications.
This middleware is designed to handle errors thrown during request processing. It checks whether the error is an instance of
ClientError
orServerError
and responds accordingly. If the error is not recognized, it defaults to creating aServerError
instance to provide a standardized error response.