Skip to content

Commit

Permalink
fix: web server error response
Browse files Browse the repository at this point in the history
  • Loading branch information
izatop committed Sep 7, 2022
1 parent 94fd67a commit bb485d4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/web/src/WebServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ import {
ValidationError,
Defer,
logger,
isError,
} from "@bunt/util";
import {IErrorResponseHeaders, IProtocolAcceptor, IResponderOptions, Responder, ResponseAbstract} from "./Transport";
import {IErrorResponseHeaders, IProtocolAcceptor, IResponderOptions, Responder} from "./Transport";

export class WebServer<C extends Context> extends Application<C> implements IDisposable, IRunnable {
@logger
Expand Down Expand Up @@ -110,11 +111,10 @@ export class WebServer<C extends Context> extends Application<C> implements IDis
await request.respond(await this.run(request));
} catch (reason) {
await request.respond(reason);
if (reason instanceof ResponseAbstract) {
return;
}

this.captureException(reason);
if (isError(reason)) {
this.captureException(reason);
}
}
}

Expand Down

0 comments on commit bb485d4

Please sign in to comment.