MCPcopy Index your code
hub / github.com/coder/coder / isApiError

Function isApiError

site/src/api/errors.ts:20–26  ·  view source on GitHub ↗
(err: unknown)

Source from the content-addressed store, hash-verified

18};
19
20export const isApiError = (err: unknown): err is ApiError => {
21 return (
22 isAxiosError(err) &&
23 err.response !== undefined &&
24 isApiErrorResponse(err.response.data)
25 );
26};
27
28/** @public Exported for use by external consumers (e.g., VS Code extension). */
29export const isApiErrorResponse = (err: unknown): err is ApiErrorResponse => {

Callers 15

WorkspaceErrorDialogFunction · 0.90
handleErrorFunction · 0.90
handleErrorFunction · 0.90
EditUserFormFunction · 0.90
TaskPausedFunction · 0.90
CreateUserFormFunction · 0.90
getApiErrorFunction · 0.90
AccountUserGroupsFunction · 0.90
handleUsageLimitErrorFunction · 0.90
AgentCreateFormFunction · 0.90
errors.test.tsFile · 0.90
ApiMethodsClass · 0.90

Calls 1

isApiErrorResponseFunction · 0.85

Tested by

no test coverage detected