Skip to content

Commit

Permalink
Improved error handling, for upload
Browse files Browse the repository at this point in the history
  • Loading branch information
PicoCreator committed Jun 10, 2022
1 parent eab3bd8 commit bdefe38
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/OutputHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class OutputHandler {
* @param {String} mainError message to send
*/
errorMessage(mainError) {
let errStr = ""+mainError;
let errStr = "[ERROR] "+mainError;
if(errStr == "[object Object]") {
errStr = JSON.stringify(mainError);
}
Expand Down
3 changes: 3 additions & 0 deletions src/api/ApiServerConnector.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ function POST(url, data, isMultipart = false) {
return axios
.post(BASE_URL + url, data, config)
.then((res) => {
if(res == null) {
return Promise.reject("Unexpected NULL response");
}
if(res.data == null) {
return Promise.reject(res.ERROR || res.error || "Missing response data : \n"+res);
}
Expand Down

0 comments on commit bdefe38

Please sign in to comment.