| 
        
       | 
      
        
  
  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
   
  
  
  
  
   
  
  
  
  
  
   
  
  
  
  
  
   
  
  
  
  
  
   
  
  
  
  
  
   
  
  
  
  
  
   
  
  
  
    
      Total comments: 20
      
     
  
  
  
   
  
  
  
  
  
   
  
  
  
  
    
  
  
    
       | 
      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
          
         | 
       
    
   
  
  
 
  
   
  
    
  
  
  
    
    Total messages: 6 (1 generated)
     
  
  
       |