We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f97139e commit d33090aCopy full SHA for d33090a
src/custom/errors.ts
@@ -33,7 +33,12 @@ export const newInfisicalError = (error: any) => {
33
const data = error?.response?.data as TApiErrorResponse;
34
35
if (data?.message) {
36
- return new InfisicalSDKRequestError(data.message, {
+ let message = data.message;
37
+ if (error.status === 422) {
38
+ message = JSON.stringify(data);
39
+ }
40
+
41
+ return new InfisicalSDKRequestError(message, {
42
url: error.response?.config.url || "",
43
method: error.response?.config.method || "",
44
statusCode: error.response?.status || 0
0 commit comments