Add URL to error objects

This commit is contained in:
Andrew Kingston 2022-01-20 14:27:43 +00:00
parent 78a36ca988
commit 55f07340e9
1 changed files with 3 additions and 0 deletions

View File

@ -45,6 +45,7 @@ export const createAPIClient = config => {
return {
message,
status: response.status,
url: response.url,
}
}
@ -53,6 +54,7 @@ export const createAPIClient = config => {
return {
message,
status: 400,
url: "",
}
}
@ -147,6 +149,7 @@ export const createAPIClient = config => {
get: requestApiCall("GET"),
patch: requestApiCall("PATCH"),
delete: requestApiCall("DELETE"),
put: requestApiCall("PUT"),
error: message => {
throw makeError(message)
},