summaryrefslogtreecommitdiff
path: root/runtime/inspector.rs
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/inspector.rs')
-rw-r--r--runtime/inspector.rs23
1 files changed, 22 insertions, 1 deletions
diff --git a/runtime/inspector.rs b/runtime/inspector.rs
index 89fd5bf57..fc0e793d9 100644
--- a/runtime/inspector.rs
+++ b/runtime/inspector.rs
@@ -859,7 +859,28 @@ impl v8::inspector::ChannelImpl for InspectorSession {
message: v8::UniquePtr<v8::inspector::StringBuffer>,
) {
let raw_message = message.unwrap().string().to_string();
- let message = serde_json::from_str(&raw_message).unwrap();
+ let message: serde_json::Value = match serde_json::from_str(&raw_message) {
+ Ok(v) => v,
+ Err(error) => match error.classify() {
+ serde_json::error::Category::Syntax => json!({
+ "id": call_id,
+ "result": {
+ "result": {
+ "type": "error",
+ "description": "Unterminated string literal",
+ "value": "Unterminated string literal",
+ },
+ "exceptionDetails": {
+ "exceptionId": 0,
+ "text": "Unterminated string literal",
+ "lineNumber": 0,
+ "columnNumber": 0
+ },
+ },
+ }),
+ _ => panic!("Could not parse inspector message"),
+ },
+ };
self
.response_tx_map