forked from EduCraft/curriculum-project-hub
feat: secure organization provider credentials
This commit is contained in:
@@ -23,6 +23,12 @@ export async function handleRouteError(reply: FastifyReply, err: unknown): Promi
|
||||
|
||||
function mapDomainError(message: string): { statusCode: number; code: string; message: string } | null {
|
||||
const lower = message.toLowerCase();
|
||||
if (lower.includes("provider credential readiness check could not reach provider")) {
|
||||
return { statusCode: 502, code: "provider_unavailable", message };
|
||||
}
|
||||
if (lower.includes("provider credential readiness check failed")) {
|
||||
return { statusCode: 400, code: "provider_credential_rejected", message };
|
||||
}
|
||||
if (lower.includes("not found")) {
|
||||
return { statusCode: 404, code: "not_found", message };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user