export class CauseException<E> extends Error {
readonly pretty: string
constructor(readonly exitCause: Cause<E>, readonly _tag: string) {
super(`An unexpected ${_tag} Exception occurred, see \`pretty\` for details.`)
this.pretty = exitCause.pretty
}
toJSON() {
return {
_tag: this._tag,
message: this.message,
pretty: this.pretty
}
}
}
export class CauseException<E> extends Error {
readonly pretty: string
constructor(readonly exitCause: Cause<E>, readonly _tag: string) {
super(`An unexpected ${_tag} Exception occurred, see \`pretty\` for details.`)
this.pretty = exitCause.pretty
}
toJSON() {
return {
_tag: this._tag,
message: this.message,
pretty: this.pretty
}
}
}