import serialize from "./serialize.ts"; export default class HttpError extends Error { constructor(public readonly body: unknown, public readonly status = 400) { super(); serialize(body).then(v => this.message = v.toString()); } }