Skip to content

Commit 794dbc3

Browse files
committed
Add return interface to formattedAxiosError getterr
1 parent a0a8334 commit 794dbc3

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/api/base.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,18 @@ import { BASE_PATH } from '../openapi/base';
77

88
import { API_ACCESS_LEVELS, ApiContextLevel, ApiKeyLevel, PermitContextError } from './context';
99

10+
interface FormattedAxiosError {
11+
code: string | undefined;
12+
message: string;
13+
error: any;
14+
status: number | undefined;
15+
}
1016
export class PermitApiError<T> extends Error {
1117
constructor(message: string, public originalError: AxiosError<T>) {
1218
super(message);
1319
}
1420

15-
public get formattedAxiosError(): any {
21+
public get formattedAxiosError(): FormattedAxiosError {
1622
return {
1723
code: this.originalError.code,
1824
message: this.message,

0 commit comments

Comments
 (0)