mirror of
https://github.com/usebruno/bruno.git
synced 2025-06-27 07:21:51 +02: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 { useState } from 'react';
|
||||||
import { useMemo } 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 { storedTheme } = useTheme();
|
||||||
const [tab, setTab] = useState('preview');
|
const [tab, setTab] = useState('preview');
|
||||||
const dispatch = useDispatch();
|
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">
|
<div className="flex justify-end gap-2 text-xs" role="tablist">
|
||||||
{getTabs()}
|
{getTabs()}
|
||||||
</div>
|
</div>
|
||||||
{activeResult}
|
{error ? <span className="text-red-500">{error}</span> : activeResult}
|
||||||
</StyledWrapper>
|
</StyledWrapper>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -42,6 +42,7 @@ const ResponsePane = ({ rightPaneWidth, item, collection }) => {
|
|||||||
width={rightPaneWidth}
|
width={rightPaneWidth}
|
||||||
data={response.data}
|
data={response.data}
|
||||||
headers={response.headers}
|
headers={response.headers}
|
||||||
|
error={response.error}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -140,6 +140,11 @@ export const sendRequest = (item, collectionUid) => (dispatch, getState) => {
|
|||||||
})
|
})
|
||||||
.then(resolve)
|
.then(resolve)
|
||||||
.catch((err) => {
|
.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 errorMessage = err.message ?? 'Something went wrong';
|
||||||
|
|
||||||
const errorResponse = {
|
const errorResponse = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user