Skip to content

Commit

Permalink
Fix untyped error (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulAsjes authored Apr 29, 2024
1 parent 1d210d6 commit ce43418
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ function getMiddlewareAuthPathRegex(pathGlob: string) {

return new RegExp(regex);
} catch (err) {
throw new Error(`Error parsing routes for middleware auth. Reason: ${err.message}`);
const message = err instanceof Error ? err.message : String(err);

throw new Error(`Error parsing routes for middleware auth. Reason: ${message}`);
}
}

Expand Down

0 comments on commit ce43418

Please sign in to comment.