Skip to content

Commit

Permalink
Small fix (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
deepaerial authored Oct 15, 2023
1 parent 4073610 commit 96d035e
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ export class API {
}
else if (exc.response) {
error_message = exc.response.data.detail;
} else {
error_message = exc.message;
} else if (exc.message) {
console.error(exc);
return;
}
throw Error(error_message);
}
Expand All @@ -40,7 +41,8 @@ export class API {
error_message = error.msg
} else error_message = exc.response.data.detail;
} else {
error_message = exc.message;
console.error(exc);
return;
}
throw Error(error_message);
}
Expand All @@ -58,7 +60,8 @@ export class API {
else if (exc.response) {
error_message = exc.response.data.detail;
} else {
error_message = exc.message;
console.error(exc);
return;
}
throw Error(error_message);
}
Expand All @@ -81,7 +84,8 @@ export class API {
else if (exc.response) {
error_message = exc.response.data.detail;
} else {
error_message = exc.message;
console.error(exc);
return;
}
throw Error(error_message);
}
Expand All @@ -108,7 +112,8 @@ export class API {
error_message = detail[0].msg;
}
} else {
error_message = exc.message;
console.error(exc);
return;
}
throw Error(error_message);
}
Expand Down Expand Up @@ -140,7 +145,8 @@ export class API {
fileReader.readAsText(data);
});
} else
error_message = exc.message;
console.error(exc);
return;
throw Error(error_message);
}
}
Expand All @@ -164,7 +170,8 @@ export class API {
error_message = detail[0].msg;
}
} else {
error_message = exc.message;
console.error(exc);
return;
}
throw Error(error_message);
}
Expand All @@ -188,7 +195,8 @@ export class API {
error_message = detail[0].msg;
}
} else {
error_message = exc.message;
console.error(exc);
return;
}
throw Error(error_message);
}
Expand Down

0 comments on commit 96d035e

Please sign in to comment.