diff --git a/lib/error.ts b/lib/error.ts index ebc97db..9bc5f8f 100644 --- a/lib/error.ts +++ b/lib/error.ts @@ -122,7 +122,7 @@ export class DescriptError { } if (this.error?.id === 'Error') { - this.error.id = ERROR_ID.UNKNOWN_ERROR; + this.error.id = ERROR_ID.JS_ERROR; } if (!this.error?.id) { diff --git a/lib/logger.ts b/lib/logger.ts index 4390878..0926909 100644 --- a/lib/logger.ts +++ b/lib/logger.ts @@ -51,6 +51,8 @@ export type LoggerEvent = SuccessLoggerEvent | ErrorLoggerEvent | StartLoggerEve class Logger { + static EVENT = EVENT; + private _debug = false; constructor(config: Config) { diff --git a/package-lock.json b/package-lock.json index ea418d6..248f8fd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "descript", - "version": "4.0.0", + "version": "4.0.1", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index 4e684c7..43ed2c0 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ }, "name": "descript", "description": "descript", - "version": "4.0.0", + "version": "4.0.1", "homepage": "https://github.com/pasaran/descript3", "repository": { "type": "git", diff --git a/tests/error.test.ts b/tests/error.test.ts index 02b9bf3..890f0a5 100644 --- a/tests/error.test.ts +++ b/tests/error.test.ts @@ -65,7 +65,7 @@ describe('de.error', () => { Object.keys(e).forEach(key => err[key] = e[key]); const error = de.error(err); - expect(error.error.id).toBe('UNKNOWN_ERROR'); + expect(error.error.id).toBe('JS_ERROR'); expect(error.error.code).toBe('ENOENT'); expect(error.error.syscall).toBe('open'); // FIXME: Может лучше .toBeDefined() использовать? diff --git a/tests/request.test.ts b/tests/request.test.ts index 2a62432..9b2059d 100644 --- a/tests/request.test.ts +++ b/tests/request.test.ts @@ -763,7 +763,7 @@ describe('request', () => { } catch (error) { expect(de.isError(error)).toBe(true); - expect(error.error.id).toBe('UNKNOWN_ERROR'); + expect(error.error.id).toBe('JS_ERROR'); expect(error.error.code).toBe('Z_DATA_ERROR'); } }); @@ -812,7 +812,7 @@ describe('request', () => { } catch (error) { expect(de.isError(error)).toBe(true); - expect(error.error.id).toBe('UNKNOWN_ERROR'); + expect(error.error.id).toBe('JS_ERROR'); expect(error.error.code).toBe('GenericFailure'); } });