mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-10 20:28:54 +00:00
Use the right error type
This commit is contained in:
@@ -158,7 +158,7 @@ export const pkiAcmeServiceFactory = ({
|
|||||||
if (error instanceof ZodError) {
|
if (error instanceof ZodError) {
|
||||||
throw new AcmeMalformedError({ detail: `Invalid JWS payload: ${error.message}` });
|
throw new AcmeMalformedError({ detail: `Invalid JWS payload: ${error.message}` });
|
||||||
}
|
}
|
||||||
if (error instanceof errors.JWSInvalid) {
|
if (error instanceof errors.JWSSignatureVerificationFailed) {
|
||||||
throw new AcmeBadPublicKeyError({ detail: "Invalid JWS payload" });
|
throw new AcmeBadPublicKeyError({ detail: "Invalid JWS payload" });
|
||||||
}
|
}
|
||||||
logger.error(error, "Unexpected error while verifying JWS payload");
|
logger.error(error, "Unexpected error while verifying JWS payload");
|
||||||
@@ -361,7 +361,7 @@ export const pkiAcmeServiceFactory = ({
|
|||||||
);
|
);
|
||||||
return { eabPayload, eabProtectedHeader };
|
return { eabPayload, eabProtectedHeader };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error instanceof errors.JWSInvalid) {
|
if (error instanceof errors.JWSSignatureVerificationFailed) {
|
||||||
throw new AcmeMalformedError({ detail: "Invalid external account binding JWS payload" });
|
throw new AcmeMalformedError({ detail: "Invalid external account binding JWS payload" });
|
||||||
}
|
}
|
||||||
logger.error(error, "Unexpected error while verifying EAB JWS payload");
|
logger.error(error, "Unexpected error while verifying EAB JWS payload");
|
||||||
|
|||||||
Reference in New Issue
Block a user