Skip to content

Commit

Permalink
fix(project): use native Error as the based class for exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
fenying committed Nov 2, 2023
1 parent 46119e1 commit a103fdf
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changes

## v1.1.1

- fix(project): use native `Error` as the based class for exceptions.

## v1.1.0

- feat(protocol): added unix socket supports.
Expand Down
4 changes: 2 additions & 2 deletions 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
@@ -1,6 +1,6 @@
{
"name": "@litert/lwdfx",
"version": "1.1.0",
"version": "1.1.1",
"description": "A TypeScript implement of light-weight data frame exchange protocol.",
"main": "lib/index.js",
"scripts": {
Expand Down
16 changes: 5 additions & 11 deletions src/lib/Errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,15 @@
/**
* The error class for LwDFX.
*/
export class LwDFXError {

public readonly stack!: string;
export class LwDFXError extends Error {

public constructor(
public readonly name: string,
public readonly message: string,
name: string,
message: string,
public readonly origin: unknown = null
) {

Error.captureStackTrace(this, LwDFXError);
}

public toString(): string {

return this.stack;
super(message);
this.name = name;
}
}

0 comments on commit a103fdf

Please sign in to comment.