Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Got missing error message #1166

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/store/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@

if (IsRTKQueryError(error)) {
const code = isFetchBaseQueryError(error) ? error.status : IsParsingError(error) ? error.originalStatus : undefined;
let errorMessage = error?.error??error?.data?.error;

Check failure on line 33 in src/store/utils/index.ts

View workflow job for this annotation

GitHub Actions / Lint

Property 'error' does not exist on type 'FetchBaseQueryError'.

Check failure on line 33 in src/store/utils/index.ts

View workflow job for this annotation

GitHub Actions / Lint

Property 'error' does not exist on type '{}'.
return {
code: code,
error: isFetchBaseQueryError(error) ? "server error" : error.error,
message: "failed to fetch data: " + (code ? getReasonPhrase(code) : "unknown")
error: errorMessage,
message: "failed to fetch data: " + (code ? getReasonPhrase(code) : "unknown") + (errorMessage ? ". " + errorMessage : "")
}
}

Expand Down
Loading