Skip to content

Commit 53fa709

Browse files
authored
Fix NetworkError handling in RecentView and getErrorMessage (#846)
1 parent cfabfe2 commit 53fa709

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

mwdb/web/src/commons/helpers/getErrorMessage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { AxiosServerErrors, GenericOrJSX } from "@mwdb-web/types/types";
44
export function getErrorMessage(
55
error: AxiosServerErrors | any
66
): GenericOrJSX<string>[] | string {
7-
if (error.response) {
7+
if (error.response && error.response.data) {
88
if (error.response.data.message) {
99
return error.response.data.message;
1010
}

mwdb/web/src/components/RecentView/Views/RecentView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export function RecentView(props: Props) {
154154

155155
const queryErrorMessage = queryError ? (
156156
<div className="form-hint">
157-
{queryError.response
157+
{queryError.response && queryError.response.data
158158
? queryError.response.data["message"]
159159
: queryError.toString()}
160160
</div>

0 commit comments

Comments
 (0)