Map errors to HTTP status codes.