ErrorHandler
api.ErrorHandler
object ErrorHandler
Provides error handling for HTTP routes in a standardised way.
The ErrorHandler
wraps existing HTTP routes and ensures that:
NotFound
errors return a404
status with a JSON-encodedErrorResponse
.- Validation errors (e.g.,
IllegalArgumentException
) return a400
status. - Unexpected errors return a
500
status with a generic message.
This utility promotes consistent error handling across the application.
Attributes
- Source
- ErrorHandler.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ErrorHandler.type
Members list
In this article