forgot string.replace doesn't actually mutate the string
This commit is contained in:
parent
119c2f827a
commit
e541a7b892
|
@ -294,7 +294,12 @@ const handleDownstreamErrors: ProxyResHandlerWithBody = async (
|
||||||
}
|
}
|
||||||
|
|
||||||
// Some OAI errors contain the organization ID, which we don't want to reveal.
|
// Some OAI errors contain the organization ID, which we don't want to reveal.
|
||||||
errorPayload.message?.replace(/org-.{24}/gm, "org-xxxxxxxxxxxxxxxxxxx");
|
if (errorPayload.error?.message) {
|
||||||
|
errorPayload.error.message = errorPayload.error.message.replace(
|
||||||
|
/org-.{24}/gm,
|
||||||
|
"org-xxxxxxxxxxxxxxxxxxx"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
res.status(statusCode).json(errorPayload);
|
res.status(statusCode).json(errorPayload);
|
||||||
throw new Error(errorPayload.error?.message);
|
throw new Error(errorPayload.error?.message);
|
||||||
|
|
Loading…
Reference in New Issue