mirror of
https://github.com/usebruno/bruno.git
synced 2025-01-03 04:29:09 +01:00
fix: fixed issue where cancelling requests was throwing an error (#146)
This commit is contained in:
parent
8e0bc68ada
commit
86094cc054
@ -122,6 +122,12 @@ export const sendRequest = (item, collectionUid) => (dispatch, getState) => {
|
|||||||
response: null
|
response: null
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if(err && err.message === "Error invoking remote method 'send-http-request': Error: Request cancelled") {
|
||||||
|
console.log('>> request cancelled');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
console.log('>> sending request failed');
|
console.log('>> sending request failed');
|
||||||
console.log(err);
|
console.log(err);
|
||||||
toast.error(err ? err.message : 'Something went wrong!');
|
toast.error(err ? err.message : 'Something went wrong!');
|
||||||
|
@ -202,6 +202,12 @@ const registerNetworkIpc = (mainWindow, watcher, lastOpenedCollections) => {
|
|||||||
// need to convey the error to the UI
|
// need to convey the error to the UI
|
||||||
// and need not be always a network error
|
// and need not be always a network error
|
||||||
deleteCancelToken(cancelTokenUid);
|
deleteCancelToken(cancelTokenUid);
|
||||||
|
|
||||||
|
if (axios.isCancel(error)) {
|
||||||
|
let error = new Error("Request cancelled");
|
||||||
|
error.isCancel = true;
|
||||||
|
return Promise.reject(error);
|
||||||
|
}
|
||||||
|
|
||||||
if(error.response) {
|
if(error.response) {
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user