Skip to content

Commit

Permalink
fix(server): Don't surface bad request error details in production (e…
Browse files Browse the repository at this point in the history
…nisdenjo#55)

* fix: don't surface error details in production

* refactor: shorten error

Co-authored-by: enisdenjo <badurinadenis@gmail.com>
  • Loading branch information
benjie and enisdenjo committed Nov 4, 2020
1 parent 7aa3bcd commit 70317b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server.ts
Expand Up @@ -663,7 +663,7 @@ export function createServer(
}
} catch (err) {
// TODO-db-201031 we perceive this as a client bad request error, but is it always?
ctx.socket.close(4400, err.message);
ctx.socket.close(4400, isProd ? 'Bad Request' : err.message);
}
};
}
Expand Down

0 comments on commit 70317b2

Please sign in to comment.