fix: 500 server error when files.create request is closed by client (#5878)

This commit is contained in:
Tom Moor
2023-09-24 16:30:52 -04:00
committed by GitHub
parent 517f2634e3
commit 136ee0ad1d
4 changed files with 161 additions and 175 deletions

View File

@@ -26,11 +26,9 @@ export function InvalidAuthenticationError(
});
}
export function AuthorizationError(
message = "You do not have permission to access this resource"
) {
export function AuthorizationError(message = "Authorization error") {
return httpErrors(403, message, {
id: "permission_required",
id: "authorization_error",
});
}
@@ -200,3 +198,11 @@ export function AuthenticationProviderDisabledError(
id: "authentication_provider_disabled",
});
}
export function ClientClosedRequestError(
message = "Client closed request before response was received"
) {
return httpErrors(499, message, {
id: "client_closed_request",
});
}