diff --git a/frontend/src/actions/common.js b/frontend/src/actions/common.js index dcbe6bbe9..6a5435bf1 100644 --- a/frontend/src/actions/common.js +++ b/frontend/src/actions/common.js @@ -64,7 +64,7 @@ export function handleErrors(reason, originalFunc){ return (dispatch) => { dispatch({ type: NOT_AUTHORIZED, - reason: "Forbidden", + reason: reason.body.detail, stack: reason.stack ? reason.stack : "", receivedAt: Date.now() }); @@ -73,7 +73,7 @@ export function handleErrors(reason, originalFunc){ return (dispatch) => { dispatch({ type: NOT_FOUND, - reason: "Not Found", + reason: reason.body.detail, stack: reason.stack ? reason.stack : "", receivedAt: Date.now() }); @@ -82,7 +82,7 @@ export function handleErrors(reason, originalFunc){ return (dispatch) => { dispatch({ type: FAILED, - reason: reason.message !== undefined? reason.message : "Backend Failure. Couldn't fetch!", + reason: reason.body.detail !== undefined? reason.body.detail : "Backend Failure. Couldn't fetch!", stack: reason.stack ? reason.stack : "", receivedAt: Date.now() }); diff --git a/frontend/src/components/Explore.tsx b/frontend/src/components/Explore.tsx index 9b9fb53d0..600a887d3 100644 --- a/frontend/src/components/Explore.tsx +++ b/frontend/src/components/Explore.tsx @@ -63,8 +63,10 @@ export const Explore = (): JSX.Element => { setErrorOpen(false); } const handleErrorReport = () => { - window.open(`${config.GHIssueBaseURL}+${reason}&body=${encodeURIComponent(stack)}`); - } + window.open( + `${config.GHIssueBaseURL}+${encodeURIComponent(reason)}&body=${encodeURIComponent(stack)}` + ); + }; // fetch thumbnails from each individual dataset/id calls useEffect(() => { diff --git a/frontend/src/components/datasets/CreateDataset.tsx b/frontend/src/components/datasets/CreateDataset.tsx index 9f0fb70d3..226cc6bdf 100644 --- a/frontend/src/components/datasets/CreateDataset.tsx +++ b/frontend/src/components/datasets/CreateDataset.tsx @@ -51,8 +51,10 @@ export const CreateDataset = (): JSX.Element => { setErrorOpen(false); } const handleErrorReport = () => { - window.open(`${config.GHIssueBaseURL}+${reason}&body=${encodeURIComponent(stack)}`); - } + window.open( + `${config.GHIssueBaseURL}+${encodeURIComponent(reason)}&body=${encodeURIComponent(stack)}` + ); + }; // step 1 const onDatasetSave = (formData:any) =>{ diff --git a/frontend/src/components/datasets/Dataset.tsx b/frontend/src/components/datasets/Dataset.tsx index 04e8049da..ee268e4dd 100644 --- a/frontend/src/components/datasets/Dataset.tsx +++ b/frontend/src/components/datasets/Dataset.tsx @@ -111,9 +111,9 @@ export const Dataset = (): JSX.Element => { dismissError(); setErrorOpen(false); }; - const handleErrorReport = (reason: string) => { + const handleErrorReport = () => { window.open( - `${config.GHIssueBaseURL}+${reason}&body=${encodeURIComponent(stack)}` + `${config.GHIssueBaseURL}+${encodeURIComponent(reason)}&body=${encodeURIComponent(stack)}` ); }; diff --git a/frontend/src/components/files/File.tsx b/frontend/src/components/files/File.tsx index f0578008f..6bca93ea6 100644 --- a/frontend/src/components/files/File.tsx +++ b/frontend/src/components/files/File.tsx @@ -106,9 +106,9 @@ export const File = (): JSX.Element => { dismissError(); setErrorOpen(false); }; - const handleErrorReport = (reason: string) => { + const handleErrorReport = () => { window.open( - `${config.GHIssueBaseURL}+${reason}&body=${encodeURIComponent(stack)}` + `${config.GHIssueBaseURL}+${encodeURIComponent(reason)}&body=${encodeURIComponent(stack)}` ); }; diff --git a/frontend/src/components/listeners/ExtractionHistory.tsx b/frontend/src/components/listeners/ExtractionHistory.tsx index 0c72098f3..9f46490bc 100644 --- a/frontend/src/components/listeners/ExtractionHistory.tsx +++ b/frontend/src/components/listeners/ExtractionHistory.tsx @@ -163,8 +163,10 @@ export const ExtractionHistory = (): JSX.Element => { setErrorOpen(false); } const handleErrorReport = () => { - window.open(`${config.GHIssueBaseURL}+${reason}&body=${encodeURIComponent(stack)}`); - } + window.open( + `${config.GHIssueBaseURL}+${encodeURIComponent(reason)}&body=${encodeURIComponent(stack)}` + ); + }; return (