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

Unified Diff: runtime/observatory/lib/src/app/location_manager.dart

Issue 1120133002: Rework error handling in the service protocol and in Observatory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix tests Created 5 years, 7 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: runtime/observatory/lib/src/app/location_manager.dart
diff --git a/runtime/observatory/lib/src/app/location_manager.dart b/runtime/observatory/lib/src/app/location_manager.dart
index 17b6c8c4057b6e10a29df38e58989f458e23fd65..fee288446c94b6efc7629d4b576c0ba3367e3faa 100644
--- a/runtime/observatory/lib/src/app/location_manager.dart
+++ b/runtime/observatory/lib/src/app/location_manager.dart
@@ -82,7 +82,8 @@ class LocationManager extends Observable {
runZoned(() => _app._visit(_uri, internalArguments),
onError: (e, st) {
if (e is IsolateNotFound) {
- var newPath = _app.vm == null ? '/vm-connect' : '/isolate-reconnect';
+ var newPath = ((_app.vm == null || _app.vm.isDisconnected)
+ ? '/vm-connect' : '/isolate-reconnect');
var parameters = {};
parameters.addAll(_uri.queryParameters);
parameters['originalPath'] = _uri.path;
@@ -91,19 +92,27 @@ class LocationManager extends Observable {
go(makeLink(generatedUri.toString()), true);
return;
}
- throw e;
+ // Surface any uncaught exceptions.
+ _app.handleException(e, st);
});
}
/// Navigate to [url].
void go(String url, [bool addToBrowserHistory = true]) {
- if ((url != makeLink('/vm-connect')) && _app.vm == null) {
+ if ((url != makeLink('/vm-connect')) &&
+ (_app.vm == null || _app.vm.isDisconnected)) {
if (!window.confirm('Connection with VM has been lost. '
'Proceeding will lose current page.')) {
return;
}
- url = makeLink('/vm-connect/');
+ url = makeLink('/vm-connect');
}
+
+ if (url == makeLink('/vm-connect')) {
+ // When we go to the vm-connect page, drop all notifications.
+ _app.notifications.clear();
+ }
+
if (addToBrowserHistory) {
_addToBrowserHistory(url);
}
« no previous file with comments | « runtime/observatory/lib/src/app/application.dart ('k') | runtime/observatory/lib/src/elements/action_link.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698