Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/angular/cli/src/utilities/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@
import assert from 'assert';

export function assertIsError(value: unknown): asserts value is Error & { code?: string } {
assert(value instanceof Error, 'catch clause variable is not an Error instance');
const isError =
value instanceof Error ||
// The following is needing to identify errors coming from RxJs.
(typeof value === 'object' && value && 'name' in value && 'message' in value);
assert(isError, 'catch clause variable is not an Error instance');
}
6 changes: 5 additions & 1 deletion packages/angular_devkit/build_angular/src/utils/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@
import assert from 'assert';

export function assertIsError(value: unknown): asserts value is Error & { code?: string } {
assert(value instanceof Error, 'catch clause variable is not an Error instance');
const isError =
value instanceof Error ||
// The following is needing to identify errors coming from RxJs.
(typeof value === 'object' && value && 'name' in value && 'message' in value);
assert(isError, 'catch clause variable is not an Error instance');
}