Skip to content

Commit

Permalink
remove the stack from HttpServerError.RouteNotFound (#3104)
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart committed Jun 27, 2024
1 parent c187493 commit 52a87c7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/stale-coats-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/platform": patch
---

remove the stack from HttpServerError.RouteNotFound
5 changes: 4 additions & 1 deletion packages/platform/src/HttpServerError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,16 @@ export const isServerError: (u: unknown) => u is HttpServerError = internal.isSe
export class RouteNotFound extends TypeIdError(TypeId, "RouteNotFound")<{
readonly request: ServerRequest.HttpServerRequest
}> {
constructor(options: { request: ServerRequest.HttpServerRequest }) {
super(options)
;(this as any).stack = `${this.name}: ${this.message}`
}
/**
* @since 1.0.0
*/
[Respondable.symbol]() {
return ServerResponse.empty({ status: 404 })
}

get message() {
return `${this.request.method} ${this.request.url} not found`
}
Expand Down

0 comments on commit 52a87c7

Please sign in to comment.