Skip to content

Commit

Permalink
use toError (from fp-ts) instead of ensure-error
Browse files Browse the repository at this point in the history
  • Loading branch information
elmarx committed May 18, 2024
1 parent adeb384 commit 3e25203
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 20 deletions.
17 changes: 0 additions & 17 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"dependencies": {
"axios": "^1.3.5",
"cors": "^2.8.5",
"ensure-error": "^3.0.1",
"express": "^4.18.2",
"express-promise-router": "^4.1.1",
"fp-ts": "^2.13.1",
Expand Down
4 changes: 2 additions & 2 deletions src/errors/input.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { InternalServerError, UnprocessableEntityError } from "./http";
import { Left } from "fp-ts/Either";
import { Left, toError } from "fp-ts/Either";
import { Errors } from "io-ts";
import { PathReporter } from "io-ts/PathReporter";
import ensureError from "ensure-error";

Check failure on line 5 in src/errors/input.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

'ensureError' is declared but its value is never read.

Check failure on line 5 in src/errors/input.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Cannot find module 'ensure-error' or its corresponding type declarations.
Expand All @@ -18,7 +18,7 @@ export class InputDecodingFailedError extends UnprocessableEntityError {

export class UnknownError extends InternalServerError {
constructor(cause: unknown) {
const error = ensureError(cause);
const error = toError(cause);

super("Unknown error occurred: " + error.message, error);
}
Expand Down

0 comments on commit 3e25203

Please sign in to comment.