Skip to content

fix: let workspace pages download partial logs for unhealthy workspaces #13761

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

Merged
merged 19 commits into from
Jul 3, 2024
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
fix: update type signature of getErrorDetail
  • Loading branch information
Parkreiner committed Jul 2, 2024
commit 6935f507edb1d97f3d60f496bc81f0b4e164f43a
11 changes: 7 additions & 4 deletions site/src/api/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,18 @@ export const getValidationErrorMessage = (error: unknown): string => {
return validationErrors.map((error) => error.detail).join("\n");
};

export const getErrorDetail = (error: unknown): string | null => {
export const getErrorDetail = (error: unknown): string | undefined => {
if (error instanceof Error) {
return "Please check the developer console for more details.";
}

if (isApiError(error)) {
return error.response.data.detail ?? null;
return error.response.data.detail;
}

if (isApiErrorResponse(error)) {
return error.detail ?? null;
return error.detail;
}
return null;

return undefined;
};