Skip to content

v3.2.1

Choose a tag to compare

@github-actions github-actions released this 26 Feb 20:32
· 8 commits to main since this release
Immutable release. Only release title and notes can be modified.
ae7b3ee

Patch Changes

  • #325 c182e59 Thanks @G4brym! - Export OrderByDirection type alias ("asc" | "desc") so consumers can import it directly instead of inlining literal unions

  • #325 c182e59 Thanks @G4brym! - Add passthroughErrors option to bypass chanfana's error handling and let errors propagate raw to the framework's error handler

    import { Hono } from "hono";
    import { fromHono, ApiException } from "chanfana";
    import { ZodError } from "zod";
    
    const app = new Hono();
    
    app.onError((err, c) => {
      // Errors arrive as raw exceptions — no HTTPException wrapping
      if (err instanceof ApiException) {
        return c.json(
          { ok: false, code: err.code, message: err.message },
          err.status as any
        );
      }
      if (err instanceof ZodError) {
        return c.json({ ok: false, validationErrors: err.issues }, 400);
      }
      return c.json({ ok: false, message: "Internal Server Error" }, 500);
    });
    
    const openapi = fromHono(app, { passthroughErrors: true });