mirror of
https://github.com/hay-kot/mealie.git
synced 2025-07-06 13:02:27 -07:00
improved error handling
This commit is contained in:
parent
a0acfdbc8f
commit
abd605918d
2 changed files with 5 additions and 7 deletions
|
@ -19,9 +19,8 @@ const apiReq = {
|
|||
post: async function(url, data) {
|
||||
let response = await axios.post(url, data).catch(function(error) {
|
||||
if (error.response) {
|
||||
console.log("Error");
|
||||
processResponse(error.response);
|
||||
return;
|
||||
return error.response;
|
||||
}
|
||||
});
|
||||
processResponse(response);
|
||||
|
@ -32,7 +31,7 @@ const apiReq = {
|
|||
let response = await axios.get(url, data).catch(function(error) {
|
||||
if (error.response) {
|
||||
processResponse(error.response);
|
||||
return;
|
||||
return response;
|
||||
} else return;
|
||||
});
|
||||
// processResponse(response);
|
||||
|
@ -43,7 +42,7 @@ const apiReq = {
|
|||
let response = await axios.delete(url, data).catch(function(error) {
|
||||
if (error.response) {
|
||||
processResponse(error.response);
|
||||
return;
|
||||
return response;
|
||||
}
|
||||
});
|
||||
processResponse(response);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue