I don't think this is the right place for this logic. The handler should either raise an exception or it should log the error and send the response message itself.