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AAK,CAAC;AACf,CAAC","sourcesContent":["import { DebugContext } from './lang';\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport const ERROR_TYPE = 'ngType';\nexport const ERROR_COMPONENT_TYPE = 'ngComponentType';\nexport const ERROR_DEBUG_CONTEXT = 'ngDebugContext';\nexport const ERROR_ORIGINAL_ERROR = 'ngOriginalError';\nexport const ERROR_LOGGER = 'ngErrorLogger';\n\nexport function getType(error: Error): Function {\n return (error as any)[ERROR_TYPE];\n}\n\nexport function getDebugContext(error: Error): DebugContext {\n return (error as any)[ERROR_DEBUG_CONTEXT];\n}\n\nexport function getOriginalError(error: Error): Error {\n return (error as any)[ERROR_ORIGINAL_ERROR];\n}\n\nfunction defaultErrorLogger(console: Console, ...values: any[]) {\n (<any>console.error)(...values);\n}\n\nexport function getErrorLogger(error: Error): (console: Console, ...values: any[]) => void {\n return (error as any)[ERROR_LOGGER] || defaultErrorLogger;\n}\n\nexport function wrappedError(message: string, originalError: any): Error {\n const msg = `${message} caused by: ${originalError instanceof Error ? originalError.message : originalError}`;\n const error = Error(msg);\n (error as any)[ERROR_ORIGINAL_ERROR] = originalError;\n return error;\n}\n"]}
\No newline at end of file