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

Issue 1120133002: Rework error handling in the service protocol and in Observatory. (Closed)

Created:
5 years, 7 months ago by turnidge
Modified:
5 years, 7 months ago
Reviewers:
Cutch
CC:
reviews_dartlang.org, Cutch, vm-dev_dartlang.org
Target Ref:
refs/remotes/git-svn
Visibility:
Public.

Description

Rework error handling in the service protocol and in Observatory. In JSON RPC, error results and regular results are distinguished structurally. We now do this in the service protocol instead of returning a regular result with the "Error" type. VM: - Add PrintError method to JSONStream. Use this to generate all errors in the service protocol. - Fix some bugs with "limit" parameter handling. - Change return value for heap rpcs when they find a collected/expired reference. - Update tests. Observatory: - Add app.handleExceptions -- this is a widely-used exception handler that puts up a notification when there is an uncaught/unexpected exception. Added a top-level zone catch that uses this handler, as well as explicit uses of this handler at various points in the code. Most pages use this implicitly or explictly, except for the debugger page, which displays exceptions in the console. [ General rule, when a function returns a Future, generally let the error pass through. If a function does async work but doesn't return the Future, then it should handle errors explicitly by calling app.handleExceptions, etc. ] - Fixed notifications. They were generally broken. Some hard-coded type names needed to be fixed, some hacks needed to be removed. - Add a new class RpcException and a variety of subclasses which capture the error cases when making an rpc. - Redo refresh buttons so their callbacks return Futures instead of taking a "done" closure. Cleaner. Allows us to move error handling outside of the callback. - Drop ServiceError, ServiceException and the associated views. - Redo notifications so that event and exception notifications are supported. - No longer null out the vm when it is disconnected. - Remove notifications when we visit the vm-connect page. Only show the "Proceeding will lose current page" dialog when we aren't on the vm-connect page already. - Improve error message on cpu profile page when profiling is disabled on the VM. - Allow variables to wrap on debugger page. - Make eval-box and eval-link tolerant of errors during rpc. Make the errors display nicely. - When a breakpoint is marked "not possible", make sure it disappears. This got broken during script view refactor. - Drop vm's errors and exceptions streams. No longer needed. R=johnmccutchan@google.com Committed: https://code.google.com/p/dart/source/detail?r=45792

Patch Set 1 #

Patch Set 2 : save my work #

Patch Set 3 : save more #

Patch Set 4 : #

Patch Set 5 : fix shrinking frames #

Patch Set 6 : pre review #

Patch Set 7 : #

Total comments: 20

Patch Set 8 : code review #

Patch Set 9 : fix tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1111 lines, -867 lines) Patch
M runtime/observatory/lib/elements.dart View 1 2 3 4 5 1 chunk +0 lines, -2 lines 0 comments Download
M runtime/observatory/lib/elements.html View 1 2 3 4 5 1 chunk +0 lines, -2 lines 0 comments Download
M runtime/observatory/lib/service_common.dart View 1 2 3 6 chunks +24 lines, -20 lines 0 comments Download
M runtime/observatory/lib/src/app/application.dart View 1 2 3 4 5 6 7 8 chunks +31 lines, -36 lines 0 comments Download
M runtime/observatory/lib/src/app/location_manager.dart View 1 2 3 4 5 6 7 2 chunks +13 lines, -4 lines 0 comments Download
M runtime/observatory/lib/src/elements/action_link.dart View 1 2 3 4 5 2 chunks +5 lines, -4 lines 0 comments Download
M runtime/observatory/lib/src/elements/action_link.html View 1 1 chunk +2 lines, -1 line 0 comments Download
M runtime/observatory/lib/src/elements/class_view.dart View 1 2 chunks +11 lines, -11 lines 0 comments Download
M runtime/observatory/lib/src/elements/code_view.dart View 1 2 chunks +11 lines, -10 lines 0 comments Download
M runtime/observatory/lib/src/elements/context_view.dart View 1 2 chunks +3 lines, -2 lines 0 comments Download
M runtime/observatory/lib/src/elements/cpu_profile.dart View 1 2 3 9 chunks +50 lines, -44 lines 0 comments Download
M runtime/observatory/lib/src/elements/cpu_profile.html View 1 4 chunks +28 lines, -4 lines 0 comments Download
M runtime/observatory/lib/src/elements/css/shared.css View 1 1 chunk +6 lines, -0 lines 0 comments Download
M runtime/observatory/lib/src/elements/debugger.dart View 1 2 3 4 8 chunks +63 lines, -39 lines 0 comments Download
M runtime/observatory/lib/src/elements/debugger.html View 1 2 3 4 5 6 7 8 10 chunks +37 lines, -11 lines 0 comments Download
M runtime/observatory/lib/src/elements/eval_box.dart View 1 2 3 4 5 1 chunk +4 lines, -1 line 0 comments Download
M runtime/observatory/lib/src/elements/eval_box.html View 1 2 3 4 5 1 chunk +9 lines, -4 lines 0 comments Download
M runtime/observatory/lib/src/elements/eval_link.dart View 1 2 3 4 5 6 7 2 chunks +11 lines, -6 lines 0 comments Download
M runtime/observatory/lib/src/elements/eval_link.html View 1 2 3 4 5 2 chunks +9 lines, -3 lines 0 comments Download
M runtime/observatory/lib/src/elements/field_view.dart View 1 2 chunks +3 lines, -2 lines 0 comments Download
M runtime/observatory/lib/src/elements/flag_list.dart View 1 2 chunks +3 lines, -2 lines 0 comments Download
M runtime/observatory/lib/src/elements/function_view.dart View 1 2 chunks +5 lines, -4 lines 0 comments Download
M runtime/observatory/lib/src/elements/heap_map.dart View 1 2 2 chunks +5 lines, -9 lines 0 comments Download
M runtime/observatory/lib/src/elements/heap_profile.dart View 1 2 3 4 5 4 chunks +19 lines, -16 lines 0 comments Download
M runtime/observatory/lib/src/elements/instance_ref.html View 1 1 chunk +1 line, -1 line 0 comments Download
M runtime/observatory/lib/src/elements/instance_view.dart View 1 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/observatory/lib/src/elements/io_view.dart View 1 2 3 4 5 12 chunks +30 lines, -30 lines 0 comments Download
M runtime/observatory/lib/src/elements/isolate_reconnect.dart View 1 1 chunk +0 lines, -3 lines 0 comments Download
M runtime/observatory/lib/src/elements/isolate_view.dart View 1 1 chunk +4 lines, -22 lines 0 comments Download
M runtime/observatory/lib/src/elements/library_view.dart View 1 1 chunk +4 lines, -4 lines 0 comments Download
M runtime/observatory/lib/src/elements/metrics.dart View 1 3 chunks +4 lines, -3 lines 0 comments Download
M runtime/observatory/lib/src/elements/nav_bar.dart View 1 2 3 4 chunks +38 lines, -21 lines 0 comments Download
M runtime/observatory/lib/src/elements/nav_bar.html View 1 2 3 4 5 6 7 5 chunks +135 lines, -35 lines 0 comments Download
M runtime/observatory/lib/src/elements/object_common.dart View 1 2 chunks +3 lines, -2 lines 0 comments Download
M runtime/observatory/lib/src/elements/object_view.dart View 1 2 chunks +3 lines, -2 lines 0 comments Download
M runtime/observatory/lib/src/elements/script_inset.dart View 1 2 3 4 5 6 7 8 3 chunks +16 lines, -6 lines 0 comments Download
M runtime/observatory/lib/src/elements/script_view.dart View 1 2 chunks +5 lines, -4 lines 0 comments Download
M runtime/observatory/lib/src/elements/service_error_view.dart View 1 2 3 4 5 1 chunk +0 lines, -17 lines 0 comments Download
M runtime/observatory/lib/src/elements/service_error_view.html View 1 2 3 4 5 1 chunk +0 lines, -21 lines 0 comments Download
D runtime/observatory/lib/src/elements/service_exception_view.dart View 1 chunk +0 lines, -17 lines 0 comments Download
D runtime/observatory/lib/src/elements/service_exception_view.html View 1 chunk +0 lines, -22 lines 0 comments Download
M runtime/observatory/lib/src/elements/service_view.dart View 1 chunk +0 lines, -10 lines 0 comments Download
M runtime/observatory/lib/src/elements/vm_connect.dart View 1 2 3 4 5 6 7 1 chunk +3 lines, -1 line 0 comments Download
M runtime/observatory/lib/src/elements/vm_view.dart View 1 2 chunks +3 lines, -2 lines 0 comments Download
M runtime/observatory/lib/src/service/object.dart View 1 2 3 4 5 6 7 8 21 chunks +145 lines, -180 lines 0 comments Download
M runtime/observatory/observatory_sources.gypi View 1 2 3 4 5 6 7 1 chunk +0 lines, -4 lines 0 comments Download
M runtime/observatory/tests/service/bad_web_socket_address_test.dart View 1 2 3 1 chunk +8 lines, -2 lines 0 comments Download
M runtime/observatory/tests/service/get_allocation_profile_rpc_test.dart View 1 2 3 1 chunk +23 lines, -8 lines 0 comments Download
M runtime/observatory/tests/service/get_object_rpc_test.dart View 1 2 3 4 5 6 7 8 8 chunks +78 lines, -23 lines 0 comments Download
M runtime/observatory/tests/service/get_retaining_path_rpc_test.dart View 1 2 3 1 chunk +11 lines, -2 lines 0 comments Download
M runtime/observatory/tests/service/malformed_test.dart View 1 2 3 1 chunk +19 lines, -11 lines 0 comments Download
M runtime/observatory/tests/service/metrics_test.dart View 1 2 3 1 chunk +23 lines, -13 lines 0 comments Download
M runtime/observatory/tests/service/native_metrics_test.dart View 1 2 3 1 chunk +30 lines, -21 lines 0 comments Download
M runtime/observatory/tests/service/test_helper.dart View 1 2 3 4 1 chunk +1 line, -4 lines 0 comments Download
M runtime/vm/json_stream.h View 1 2 3 4 5 6 7 8 2 chunks +18 lines, -0 lines 0 comments Download
M runtime/vm/json_stream.cc View 1 2 3 4 5 6 7 8 1 chunk +68 lines, -0 lines 0 comments Download
M runtime/vm/profiler_service.cc View 1 1 chunk +1 line, -3 lines 0 comments Download
M runtime/vm/service.cc View 1 2 3 4 5 6 7 8 23 chunks +76 lines, -127 lines 0 comments Download
M runtime/vm/service_test.cc View 1 2 3 4 5 6 7 8 7 chunks +7 lines, -7 lines 0 comments Download

Messages

Total messages: 6 (1 generated)
turnidge
5 years, 7 months ago (2015-05-12 19:05:24 UTC) #2
Cutch
https://codereview.chromium.org/1120133002/diff/120001/runtime/observatory/lib/src/app/application.dart File runtime/observatory/lib/src/app/application.dart (right): https://codereview.chromium.org/1120133002/diff/120001/runtime/observatory/lib/src/app/application.dart#newcode79 runtime/observatory/lib/src/app/application.dart:79: bool isPauseEvent(ServiceEvent event) { this method should be on ...
5 years, 7 months ago (2015-05-13 17:50:10 UTC) #3
turnidge
https://codereview.chromium.org/1120133002/diff/120001/runtime/observatory/lib/src/app/application.dart File runtime/observatory/lib/src/app/application.dart (right): https://codereview.chromium.org/1120133002/diff/120001/runtime/observatory/lib/src/app/application.dart#newcode79 runtime/observatory/lib/src/app/application.dart:79: bool isPauseEvent(ServiceEvent event) { On 2015/05/13 17:50:09, Cutch wrote: ...
5 years, 7 months ago (2015-05-14 17:53:44 UTC) #4
Cutch
lgtm
5 years, 7 months ago (2015-05-14 18:29:04 UTC) #5
turnidge
5 years, 7 months ago (2015-05-14 19:35:28 UTC) #6
Message was sent while issue was closed.
Committed patchset #9 (id:160001) manually as 45792 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698