Trace: • REST Exception Handling
This is an old revision of the document!
Our standard REST services come with standard exception handling. This means that all server-side exceptions send the http status code 400 (Bad Request) to the client. The implementation already checks some exception types and returns custom http status codes:
Exception | http status |
---|---|
UnknownObjectException | 404 (not found) |
SecurityException | 403 (forbidden) |
InvalidPasswordException | 401 (unauthorized) |
If you want custom status codes, it's possible to throw RestServiceException. This Exception class supports custom status codes and error messages.