Index: src/debug-debugger.js |
diff --git a/src/debug-debugger.js b/src/debug-debugger.js |
index 163a0bd82959d9f248df5a673823378ed44c3820..4082a796172185f626562313c207ab521d96885d 100644 |
--- a/src/debug-debugger.js |
+++ b/src/debug-debugger.js |
@@ -1306,9 +1306,12 @@ ProtocolMessage.prototype.setOption = function(name, value) { |
}; |
-ProtocolMessage.prototype.failed = function(message) { |
+ProtocolMessage.prototype.failed = function(message, opt_details) { |
this.success = false; |
this.message = message; |
+ if (IS_OBJECT(opt_details)) { |
+ this.error_details = opt_details; |
+ } |
}; |
@@ -1355,6 +1358,9 @@ ProtocolMessage.prototype.toJSONProtocol = function() { |
if (this.message) { |
json.message = this.message; |
} |
+ if (this.error_details) { |
+ json.error_details = this.error_details; |
+ } |
json.running = this.running; |
return JSON.stringify(json); |
}; |
@@ -2387,8 +2393,17 @@ DebugCommandProcessor.prototype.changeLiveRequest_ = function( |
var new_source = request.arguments.new_source; |
- var result_description = Debug.LiveEdit.SetScriptSource(the_script, |
- new_source, preview_only, change_log); |
+ var result_description; |
+ try { |
+ result_description = Debug.LiveEdit.SetScriptSource(the_script, |
+ new_source, preview_only, change_log); |
+ } catch (e) { |
+ if (e instanceof Debug.LiveEdit.Failure && "details" in e) { |
+ response.failed(e.message, e.details); |
+ return; |
+ } |
+ throw e; |
+ } |
response.body = {change_log: change_log, result: result_description}; |
if (!preview_only && !this.running_ && result_description.stack_modified) { |