Use custom exception classes to facilitate better error reporting on the client side