diff --git a/package.json b/package.json index 19ad26c..356affb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@internxt/sdk", "author": "Internxt ", - "version": "1.13.1", + "version": "1.13.2", "description": "An sdk for interacting with Internxt's services", "repository": { "type": "git", diff --git a/src/index.ts b/src/index.ts index 1ee056f..dd4156a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,5 @@ export * from './auth'; +export { AppError } from './shared'; export * as Drive from './drive'; export * as Network from './network'; export * as Shared from './shared'; diff --git a/src/shared/index.ts b/src/shared/index.ts index 13614ba..3be4641 100644 --- a/src/shared/index.ts +++ b/src/shared/index.ts @@ -1 +1,2 @@ export * from './types/apiConnection'; +export { default as AppError } from './types/errors'; diff --git a/src/shared/types/errors.ts b/src/shared/types/errors.ts index a0d6524..0e5c587 100644 --- a/src/shared/types/errors.ts +++ b/src/shared/types/errors.ts @@ -2,6 +2,7 @@ export default class AppError extends Error { public readonly status?: number; public readonly code?: string; public readonly headers?: Record; + public readonly requestId?: string; constructor(message: string, status?: number, code?: string, headers?: Record) { super(message); @@ -9,5 +10,6 @@ export default class AppError extends Error { this.status = status; this.code = code; this.headers = headers; + this.requestId = headers?.['x-request-id']; } }