mirror of
https://github.com/usebruno/bruno.git
synced 2025-01-11 00:18:46 +01:00
update: showing error in queryresult component
This commit is contained in:
parent
d4683ab961
commit
571b4459ac
@ -11,7 +11,7 @@ import StyledWrapper from './StyledWrapper';
|
||||
import { useState } from 'react';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
const QueryResult = ({ item, collection, data, width, disableRunEventListener, headers }) => {
|
||||
const QueryResult = ({ item, collection, data, width, disableRunEventListener, headers, error }) => {
|
||||
const { storedTheme } = useTheme();
|
||||
const [tab, setTab] = useState('preview');
|
||||
const dispatch = useDispatch();
|
||||
@ -113,7 +113,7 @@ const QueryResult = ({ item, collection, data, width, disableRunEventListener, h
|
||||
<div className="flex justify-end gap-2 text-xs" role="tablist">
|
||||
{getTabs()}
|
||||
</div>
|
||||
{activeResult}
|
||||
{error ? <span className="text-red-500">{error}</span> : activeResult}
|
||||
</StyledWrapper>
|
||||
);
|
||||
};
|
||||
|
@ -42,6 +42,7 @@ const ResponsePane = ({ rightPaneWidth, item, collection }) => {
|
||||
width={rightPaneWidth}
|
||||
data={response.data}
|
||||
headers={response.headers}
|
||||
error={response.error}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -140,6 +140,11 @@ export const sendRequest = (item, collectionUid) => (dispatch, getState) => {
|
||||
})
|
||||
.then(resolve)
|
||||
.catch((err) => {
|
||||
if (err && err.message === "Error invoking remote method 'send-http-request': Error: Request cancelled") {
|
||||
console.log('>> request cancelled');
|
||||
return;
|
||||
}
|
||||
|
||||
const errorMessage = err.message ?? 'Something went wrong';
|
||||
|
||||
const errorResponse = {
|
||||
|
Loading…
Reference in New Issue
Block a user