@teardown/errors 0.1.40 → 0.1.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +7 -7
  2. package/src/index.ts +8 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teardown/errors",
3
- "version": "0.1.40",
3
+ "version": "0.1.43",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -30,15 +30,15 @@
30
30
  "prepublishOnly": "bun x turbo run build"
31
31
  },
32
32
  "devDependencies": {
33
- "@biomejs/biome": "2.3.7",
34
- "@teardown/tsconfig": "0.1.40",
35
- "@types/bun": "1.3.3"
33
+ "@biomejs/biome": "2.3.8",
34
+ "@teardown/tsconfig": "0.1.43",
35
+ "@types/bun": "1.3.4"
36
36
  },
37
37
  "peerDependencies": {
38
- "typescript": "^5.9.3",
39
- "zod": "^4"
38
+ "typescript": "5.9.3",
39
+ "zod": "4.1.13"
40
40
  },
41
41
  "dependencies": {
42
- "elysia": "1.4.16"
42
+ "elysia": "1.4.17"
43
43
  }
44
44
  }
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Elysia, type ValidationError } from "elysia";
1
+ import { Elysia, ValidationError } from "elysia";
2
2
  import { ZodError } from "zod";
3
3
 
4
4
  export enum ErrorCodes {
@@ -278,6 +278,13 @@ export const ElysiaErrors = new Elysia()
278
278
  SERVICE_UNAVAILABLE: InternalServerError,
279
279
  })
280
280
  .onError(({ error, code, set }) => {
281
+ // Skip logging validation errors - they're expected and properly handled by Elysia
282
+ if (error instanceof ValidationError || code === "VALIDATION") {
283
+ const result = handleError(error, code);
284
+ set.status = result.status;
285
+ return result.body;
286
+ }
287
+
281
288
  console.error("[ErrorHandler] Unhandled error:", {
282
289
  code,
283
290
  error,