Skip to content

Commit

Permalink
🐛 Fix(index.ts): MyError export
Browse files Browse the repository at this point in the history
  • Loading branch information
INeedJobToStartWork committed Aug 5, 2024
1 parent 18fb60d commit de89b37
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# oh-my-error

## 1.1.1

### Patch Changes

- fix `MyError` export

## 1.1.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oh-my-error",
"version": "1.1.0",
"version": "1.1.1",
"description": "A simple error handler for nodejs",
"keywords": [
"error",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { myErrorCatcher, myErrorHandler, myErrorWrapper } from "@/utils";
export { MyError, myErrorCatcher, myErrorHandler, myErrorWrapper } from "@/utils";

export type { TErrorReturn, TFunctionReturn, TMyError, TDataReturn, TMyErrorList, TMyHandler } from "@/utils/types";
1 change: 1 addition & 0 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from "./myErrorCatcher";
export * from "./myErrorWrapper";
export * from "./myErrorHandler";
export * from "./myError";
2 changes: 1 addition & 1 deletion src/utils/myError.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { TMyError } from "./types";

// export const MyError = <TCustom = NonNullable<unknown>>(error: TMyError<TCustom>): TMyError<TCustom> => error;
class MyError<TCustom = NonNullable<unknown>> {
export class MyError<TCustom = NonNullable<unknown>> {
public code: TMyError<TCustom>["code"];
public hint: TMyError<TCustom>["hint"];
public message: TMyError<TCustom>["message"];
Expand Down

0 comments on commit de89b37

Please sign in to comment.