Method
create
(
message: string,
code: SMTPErrorState,
error?: Error | null,
smtp?: unknown
)
Source from the content-addressed store, hash-verified
| 24 | } |
| 25 | |
| 26 | public static create( |
| 27 | message: string, |
| 28 | code: SMTPErrorState, |
| 29 | error?: Error | null, |
| 30 | smtp?: unknown |
| 31 | ) { |
| 32 | const msg = error?.message ? `${message} (${error.message})` : message |
| 33 | const err = new SMTPError(msg) |
| 34 | |
| 35 | err.code = code |
| 36 | err.smtp = smtp |
| 37 | |
| 38 | if (error) { |
| 39 | err.previous = error |
| 40 | } |
| 41 | |
| 42 | return err |
| 43 | } |
| 44 | } |
Tested by
no test coverage detected