[vmservice] Report expression compilation errors

Change-Id: I4209321f1ae69e1e411c642a905861e4e561836c
Reviewed-on: https://dart-review.googlesource.com/61402
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
diff --git a/sdk/lib/vmservice/running_isolates.dart b/sdk/lib/vmservice/running_isolates.dart
index 4ef37d1..5e7b6dd 100644
--- a/sdk/lib/vmservice/running_isolates.dart
+++ b/sdk/lib/vmservice/running_isolates.dart
@@ -152,7 +152,11 @@
       return completer.future
           .then((String s) => jsonDecode(s))
           .then((dynamic json) {
-        return json['result']['result']['kernelBytes'];
+        Map<String, dynamic> jsonMap = json;
+        if (jsonMap.containsKey('error')) {
+          throw jsonMap['error'];
+        }
+        return jsonMap['result']['result']['kernelBytes'];
       });
     } else {
       // fallback to compile using kernel service