{"version":3,"sources":["exception_handler.js"],"names":[],"mappings":"AAAA,KAAO,EAAC,UAAS,CAAC,KAAO,cAAY,CAAC;AACtC,KAAO,EAAC,SAAQ;AAAG,MAAI,CAAC,KAAO,2BAAyB,CAAC;AACzD,KAAO,EAAC,WAAU;AAAG,mBAAiB,CAAC,KAAO,iCAA+B,CAAC;AAgC9E,KAAO,MAAM,iBAAe;AAC1B,KAAG,CAAE,KAAI,CAAG,CAAA,UAAS,EAAI,KAAG,CAAG,CAAA,MAAK,EAAI,KAAG,CAAG;AAC5C,AAAI,MAAA,CAAA,cAAa,EAAI,CAAA,kBAAiB,AAAC,CAAC,UAAS,CAAC,CAAA,CAAI,CAAA,WAAU,KAAK,AAAC,CAAC,UAAS,CAAG,OAAK,CAAC,CAAA,CAAI,WAAS,CAAC;AACvG,AAAI,MAAA,CAAA,SAAQ,EAAI,CAAA,SAAQ,AAAC,CAAC,MAAK,CAAC,CAAA,CAAI,MAAK,MAAK,GAAE,CAAI,GAAC,CAAC;AACtD,QAAI,AAAC,CAAC,GAAG,KAAI,GAAI,SAAQ,kBAAmB,cAAa,EAAE,CAAC,CAAC;EAC/D;AAAA,AACF;AAAA,AAxCA,KAAK,eAAe,AAAC,iCACb,EAAC,GAAE,CAAG,UAAS,AAAD,CAAG;AAAC,cAgCzB,WAAS,AAAC,EAAC,EAhCqC;EAAC,CAAC,CAAC,CAAC;AAwCrD","file":"angular2/src/core/exception_handler.es6","sourcesContent":["import {Injectable} from 'angular2/di';\nimport {isPresent, print} from 'angular2/src/facade/lang';\nimport {ListWrapper, isListLikeIterable} from 'angular2/src/facade/collection';\n\n/**\n * Provides a hook for centralized exception handling.\n *\n * The default implementation of `ExceptionHandler` prints error messages to the `Console`. To intercept error handling,\n * write a custom exception handler that replaces this default as appropriate for your app.\n *\n * # Example\n *\n * ```javascript\n * @Component({\n *   selector: 'my-app',\n *   injectables: [\n *     bind(ExceptionHandler).toClass(MyExceptionHandler)\n *   ]\n * })\n * @View(...)\n * class MyApp { ... }\n *\n *\n * class MyExceptionHandler implements ExceptionHandler {\n *   call(error, stackTrace = null, reason = null) {\n *     // do something with the exception\n *   }\n * }\n *\n * ```\n *\n * @exportedAs angular2/core\n */\n@Injectable()\nexport class ExceptionHandler {\n  call(error, stackTrace = null, reason = null) {\n    var longStackTrace = isListLikeIterable(stackTrace) ? ListWrapper.join(stackTrace, \"\\n\\n\") : stackTrace;\n    var reasonStr = isPresent(reason) ? `\\n${reason}` : '';\n    print(`${error}${reasonStr}\\nSTACKTRACE:\\n${longStackTrace}`);\n  }\n}\n"]}