mirror of
https://github.com/denoland/std.git
synced 2024-11-21 20:50:22 +00:00
fix(assert): fix assertion error message of isError (#6147)
Co-authored-by: eryue0220 <eryue0220@users.noreply.github.com>
This commit is contained in:
parent
ed79df4696
commit
8c9b4c6972
@ -36,7 +36,7 @@ export function assertIsError<E extends Error = Error>(
|
|||||||
const msgSuffix = msg ? `: ${msg}` : ".";
|
const msgSuffix = msg ? `: ${msg}` : ".";
|
||||||
if (!(error instanceof Error)) {
|
if (!(error instanceof Error)) {
|
||||||
throw new AssertionError(
|
throw new AssertionError(
|
||||||
`Expected "error" to be an Error object${msgSuffix}}`,
|
`Expected "error" to be an Error object${msgSuffix}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (ErrorClass && !(error instanceof ErrorClass)) {
|
if (ErrorClass && !(error instanceof ErrorClass)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user