Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4: types fixes #66

Merged
merged 3 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions lib/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ export type LoggerEvent = SuccessLoggerEvent | ErrorLoggerEvent | StartLoggerEve


class Logger {
static EVENT = EVENT;

private _debug = false;

constructor(config: Config) {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tests/error.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() использовать?
Expand Down
4 changes: 2 additions & 2 deletions tests/request.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
});
Expand Down Expand Up @@ -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');
}
});
Expand Down
Loading