Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Unified Diff: third_party/pkg/angular/lib/core/exception_handler.dart

Issue 124053002: Adding Angular and dependent packages for testing (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/pkg/angular/lib/core/exception_handler.dart
diff --git a/third_party/pkg/angular/lib/core/exception_handler.dart b/third_party/pkg/angular/lib/core/exception_handler.dart
new file mode 100644
index 0000000000000000000000000000000000000000..a9d58599653fb39c475cbc15858840a5d403ed37
--- /dev/null
+++ b/third_party/pkg/angular/lib/core/exception_handler.dart
@@ -0,0 +1,23 @@
+part of angular.core;
+
+/**
+ * Any uncaught exception in angular expressions is delegated to this service.
+ * The default implementation logs exceptions into console.
+ *
+ * In your application it is expected that this service is overridden with
+ * your implementation which can store the exception for later processing.
+ */
+@NgInjectableService()
+class ExceptionHandler {
+
+ /**
+ * Delegate uncaught exception for central error handling.
+ *
+ * - [error] The error which was caught.
+ * - [stack] The stacktrace.
+ * - [reason] Optional contextual information for the error.
+ */
+ call(dynamic error, dynamic stack, [String reason = '']){
+ print("$error\n$reason\nSTACKTRACE:\n$stack");
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698