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

Unified Diff: runtime/include/dart_api.h

Issue 9316071: Dart_PropagateError, take 2. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 11 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
« no previous file with comments | « no previous file | runtime/lib/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/include/dart_api.h
===================================================================
--- runtime/include/dart_api.h (revision 3862)
+++ runtime/include/dart_api.h (working copy)
@@ -140,6 +140,30 @@
*/
DART_EXPORT Dart_Handle Dart_Error(const char* format, ...);
+/**
+ * Propagates an error.
+ *
+ * It only makes sense to call this function when there are dart
+ * frames on the stack. That is, this function should only be called
+ * in the C implementation of a native function which has been called
+ * from Dart code. If this function is called in the top-level
+ * embedder code, it will return an error, as there is no way to
+ * further propagate the error.
+ *
+ * The provided handle must be an error handle. (See Dart_IsError.)
+ *
+ * If the provided handle is an unhandled exception, this function
+ * will cause the unhandled exception to be rethrown. Otherwise, the
+ * error will be propagated to the caller, discarding any active dart
+ * frames up to the next C frame.
+ *
+ * \param An error handle.
+ *
+ * \return On success, this function does not return. On failure, an
+ * error handle is returned.
+ */
+DART_EXPORT Dart_Handle Dart_PropagateError(Dart_Handle handle);
+
// Internal routine used for reporting error handles.
DART_EXPORT void _Dart_ReportErrorHandle(const char* file,
int line,
« no previous file with comments | « no previous file | runtime/lib/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698