Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Commit a97974d

Browse files
committed
fix(sdk): catching server error message
1 parent 23ed1ca commit a97974d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/sdk.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export default class Strapi {
122122
});
123123
return response.data;
124124
} catch (error) {
125-
throw error.response.message;
125+
throw error.response.data.message;
126126
}
127127
}
128128

@@ -177,7 +177,7 @@ export default class Strapi {
177177
public deleteEntry(contentType: string, id: string): Promise<any> {
178178
return this.request('delete', `/${contentType}/${id}`);
179179
}
180-
180+
181181
private setToken(token: string): void {
182182
this.axios.defaults.headers.common.Authorization = 'Bearer ' + token;
183183
}

0 commit comments

Comments
 (0)