fix(assert): fix assertion error message of isError (#6147)

Co-authored-by: eryue0220 <eryue0220@users.noreply.github.com>
This commit is contained in:
Yoshiya Hinosawa 2024-10-25 20:04:05 +09:00 committed by GitHub
parent ed79df4696
commit 8c9b4c6972
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)) {