MCPcopy Index your code
hub / github.com/angular/angular / createRuntimeError

Function createRuntimeError

packages/core/src/render3/errors_di.ts:128–139  ·  view source on GitHub ↗
(message: string, code: number, path?: string[])

Source from the content-addressed store, hash-verified

126 * be reused later, before throwing the final error.
127 */
128export function createRuntimeError(message: string, code: number, path?: string[]): Error {
129 // Cast to `any`, so that extra info can be monkey-patched onto this instance.
130 const error = new RuntimeError(code, message) as any;
131
132 // Monkey-patch a runtime error code and a path onto an Error instance.
133 error[NG_RUNTIME_ERROR_CODE] = code;
134 error[NG_RUNTIME_ERROR_MESSAGE] = message;
135 if (path) {
136 error[NG_TOKEN_PATH] = path;
137 }
138 return error;
139}
140
141/**
142 * Reads monkey-patched error code from the given Error instance.

Callers 2

getMethod · 0.90
cyclicDependencyErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…