diff --git a/src/errors/ApiError.ts b/src/errors/ApiError.ts index a6bc595b..9710a12a 100644 --- a/src/errors/ApiError.ts +++ b/src/errors/ApiError.ts @@ -27,36 +27,6 @@ export default class ApiError extends Error { Object.defineProperty(this, 'message', { enumerable: true }); } - /** - * Get the error message - * - * @since 3.0.0 - * @deprecated Use `error.message` instead. - */ - public getMessage(): string { - return this.message; - } - - /** - * Get the field name that contains an error - * - * @since 3.0.0 - * @deprecated Use `error.field` instead. - */ - public getField(): Maybe { - return this.field; - } - - /** - * Get the API status code - * - * @since 3.0.0 - * @deprecated Use `error.statusCode` instead. - */ - public getStatusCode(): Maybe { - return this.statusCode; - } - /** * Get the documentation URL * diff --git a/tests/unit/resources/methods.test.ts b/tests/unit/resources/methods.test.ts index 3d9ac7fa..dff843a5 100644 --- a/tests/unit/resources/methods.test.ts +++ b/tests/unit/resources/methods.test.ts @@ -46,7 +46,7 @@ describe('methods', () => { }) .catch(err => { expect(err).toBeInstanceOf(ApiError); - expect(err.getMessage()).toEqual(error.detail); + expect(err.message).toEqual(error.detail); }); }); }); @@ -57,7 +57,7 @@ describe('methods', () => { return new Promise(resolve => { methods.get('foo', {}, (err: any, result) => { expect(err).toBeInstanceOf(ApiError); - expect(err.getMessage()).toEqual(error.detail); + expect(err.message).toEqual(error.detail); expect(result).toBeUndefined(); resolve(); });