Skip to content

Commit

Permalink
show correct message for limit cards
Browse files Browse the repository at this point in the history
  • Loading branch information
David Hernandez committed Aug 8, 2024
1 parent 87c0c36 commit 0cc421d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tonder.io/ionic-lite-sdk",
"version": "0.0.34-beta.2",
"version": "0.0.34-beta.3",
"description": "Tonder ionic lite SDK",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
6 changes: 4 additions & 2 deletions src/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ const buildErrorResponse = async (
response: Response,
stack: string | undefined = undefined
): Promise<ErrorResponse> => {

let body, status, message = "Error";

if (response && "json" in response) {
Expand All @@ -46,10 +45,13 @@ const buildErrorResponse = async (
status = response.status.toString();
}

if (response && "text" in response) {
if (!body && response && "text" in response) {
message = await response.text();
}

if(body?.detail){
message = body.detail
}
const error = new ErrorResponse({
code: status,
body: body,
Expand Down

0 comments on commit 0cc421d

Please sign in to comment.