diff options
Diffstat (limited to 'cli/ops/worker_host.rs')
-rw-r--r-- | cli/ops/worker_host.rs | 68 |
1 files changed, 30 insertions, 38 deletions
diff --git a/cli/ops/worker_host.rs b/cli/ops/worker_host.rs index e4e0d84a4..f2e936ef2 100644 --- a/cli/ops/worker_host.rs +++ b/cli/ops/worker_host.rs @@ -294,46 +294,38 @@ fn serialize_worker_event(event: WorkerEvent) -> Value { match event { WorkerEvent::Message(buf) => json!({ "type": "msg", "data": buf }), WorkerEvent::TerminalError(error) => match error.downcast::<JsError>() { - Ok(js_error) => { - json!({ - "type": "terminalError", - "error": { - "message": js_error.message, - "fileName": js_error.script_resource_name, - "lineNumber": js_error.line_number, - "columnNumber": js_error.start_column, - } - }) - } - Err(error) => { - json!({ - "type": "terminalError", - "error": { - "message": error.to_string(), - } - }) - } + Ok(js_error) => json!({ + "type": "terminalError", + "error": { + "message": js_error.message, + "fileName": js_error.script_resource_name, + "lineNumber": js_error.line_number, + "columnNumber": js_error.start_column, + } + }), + Err(error) => json!({ + "type": "terminalError", + "error": { + "message": error.to_string(), + } + }), }, WorkerEvent::Error(error) => match error.downcast::<JsError>() { - Ok(js_error) => { - json!({ - "type": "error", - "error": { - "message": js_error.message, - "fileName": js_error.script_resource_name, - "lineNumber": js_error.line_number, - "columnNumber": js_error.start_column, - } - }) - } - Err(error) => { - json!({ - "type": "error", - "error": { - "message": error.to_string(), - } - }) - } + Ok(js_error) => json!({ + "type": "error", + "error": { + "message": js_error.message, + "fileName": js_error.script_resource_name, + "lineNumber": js_error.line_number, + "columnNumber": js_error.start_column, + } + }), + Err(error) => json!({ + "type": "error", + "error": { + "message": error.to_string(), + } + }), }, } } |