mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-22 07:53:34 +01:00
chore: dispatch null response when req is cancelled
This commit is contained in:
parent
6c3dc7bbd2
commit
5d1be2f18a
@ -144,17 +144,22 @@ export const sendRequest = (item, collectionUid) => (dispatch, getState) => {
|
|||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
if (err && err.message === "Error invoking remote method 'send-http-request': Error: Request cancelled") {
|
if (err && err.message === "Error invoking remote method 'send-http-request': Error: Request cancelled") {
|
||||||
console.log('>> request cancelled');
|
console.log('>> request cancelled');
|
||||||
|
dispatch(
|
||||||
|
responseReceived({
|
||||||
|
itemUid: item.uid,
|
||||||
|
collectionUid: collectionUid,
|
||||||
|
response: null
|
||||||
|
})
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const errorMessage = err.message ?? 'Something went wrong';
|
|
||||||
|
|
||||||
const errorResponse = {
|
const errorResponse = {
|
||||||
status: 'Error',
|
status: 'Error',
|
||||||
isError: true,
|
isError: true,
|
||||||
error: errorMessage,
|
error: err.message ?? 'Something went wrong',
|
||||||
size: '0',
|
size: 0,
|
||||||
duration: '0'
|
duration: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
dispatch(
|
dispatch(
|
||||||
|
Loading…
Reference in New Issue
Block a user