RestHandler handles exceptions