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

Unified Diff: runtime/bin/file_system_watcher.cc

Issue 939643002: Add error handling when initializing the file system watcher (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | « runtime/bin/file_patch.dart ('k') | runtime/bin/file_system_watcher_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file_system_watcher.cc
diff --git a/runtime/bin/file_system_watcher.cc b/runtime/bin/file_system_watcher.cc
index 0260be7b5904ab76c22c1e32ad3b9d0585f804c3..164346c681ea26389eb40fdc8b9470018c3f24c8 100644
--- a/runtime/bin/file_system_watcher.cc
+++ b/runtime/bin/file_system_watcher.cc
@@ -6,6 +6,7 @@
#include "bin/builtin.h"
#include "bin/dartutils.h"
+#include "bin/utils.h"
#include "include/dart_api.h"
@@ -18,7 +19,15 @@ void FUNCTION_NAME(FileSystemWatcher_IsSupported)(Dart_NativeArguments args) {
void FUNCTION_NAME(FileSystemWatcher_InitWatcher)(Dart_NativeArguments args) {
- Dart_SetReturnValue(args, Dart_NewInteger(FileSystemWatcher::Init()));
+ intptr_t id = FileSystemWatcher::Init();
+ if (id >= 0) {
+ Dart_SetReturnValue(args, Dart_NewInteger(id));
+ } else {
+ OSError os_error;
+ Dart_Handle error = DartUtils::NewDartOSError(&os_error);
kustermann 2015/02/18 13:10:10 Would it be possible to give some error message?
+ if (Dart_IsError(error)) Dart_PropagateError(error);
+ Dart_ThrowException(error);
+ }
}
« no previous file with comments | « runtime/bin/file_patch.dart ('k') | runtime/bin/file_system_watcher_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698