Index: runtime/vm/service.cc |
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc |
index 087e47e5199862243e51f0268d63bcf0648c7c43..09da5f340d51005005f913c51736fd27b68819f3 100644 |
--- a/runtime/vm/service.cc |
+++ b/runtime/vm/service.cc |
@@ -2484,19 +2484,24 @@ static bool ReloadSources(Thread* thread, JSONStream* js) { |
"This isolate is being reloaded."); |
return true; |
} |
- DebuggerStackTrace* stack = isolate->debugger()->StackTrace(); |
- ASSERT(isolate->CanReload()); |
- |
- if (stack->Length() > 0) { |
- // TODO(turnidge): We need to support this case. |
+ if (!isolate->CanReload()) { |
js->PrintError(kFeatureDisabled, |
- "Source can only be reloaded when stack is empty."); |
+ "This isolate cannot reload sources right now."); |
return true; |
- } else { |
- isolate->ReloadSources(); |
} |
- PrintSuccess(js); |
+ isolate->ReloadSources(); |
+ |
+ const Error& error = Error::Handle(isolate->sticky_reload_error()); |
+ |
+ if (error.IsNull()) { |
+ PrintSuccess(js); |
+ } else { |
+ // Clear the sticky error. |
+ isolate->clear_sticky_reload_error(); |
+ js->PrintError(kIsolateReloadFailed, |
+ "Isolate reload failed: %s", error.ToErrorCString()); |
+ } |
return true; |
Florian Schneider
2016/06/16 17:30:00
This function never seems to return false. Is the
Cutch
2016/06/16 18:02:26
A service protocol handler can return false if the
|
} |