Chromium Code Reviews| 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); |
| + } |
| } |