Commit 2775ad63 authored by Simon Zünd's avatar Simon Zünd Committed by V8 LUCI CQ

[inspector] Use 'ServerError' code for application level error

This CL replaces 'InvalidArgument' with 'ServerError' for
Runtime#getExceptionDetails. The reason is that the error we
raise is on the application level, allowing the DevTools frontend
to handle it to a certain degree. 'InvalidArgument' errors would be
interpreted as "something went really wrong", which is not the case
here.

Bug: chromium:1280141
Change-Id: Id72f06ce8daa06875adeb2528638a80ae61d9e55
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3420304Reviewed-by: 's avatarKim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78809}
parent e78a351f
...@@ -818,7 +818,7 @@ Response V8RuntimeAgentImpl::getExceptionDetails( ...@@ -818,7 +818,7 @@ Response V8RuntimeAgentImpl::getExceptionDetails(
const v8::Local<v8::Value> error = scope.object(); const v8::Local<v8::Value> error = scope.object();
if (!error->IsNativeError()) if (!error->IsNativeError())
return Response::InvalidParams("errorObjectId is not a JS error object"); return Response::ServerError("errorObjectId is not a JS error object");
const v8::Local<v8::Message> message = const v8::Local<v8::Message> message =
v8::debug::CreateMessageFromException(m_inspector->isolate(), error); v8::debug::CreateMessageFromException(m_inspector->isolate(), error);
......
...@@ -23,14 +23,14 @@ Running test: itShouldReturnExceptionDetailsForJSErrorObjects ...@@ -23,14 +23,14 @@ Running test: itShouldReturnExceptionDetailsForJSErrorObjects
functionName : foo functionName : foo
lineNumber : 2 lineNumber : 2
scriptId : <scriptId> scriptId : <scriptId>
url : url :
} }
[1] : { [1] : {
columnNumber : 0 columnNumber : 0
functionName : functionName :
lineNumber : 4 lineNumber : 4
scriptId : <scriptId> scriptId : <scriptId>
url : url :
} }
] ]
} }
...@@ -63,7 +63,7 @@ Running test: itShouldReturnIncompleteDetailsForJSErrorWithNoStack ...@@ -63,7 +63,7 @@ Running test: itShouldReturnIncompleteDetailsForJSErrorWithNoStack
Running test: itShouldReportAnErrorForNonJSErrorObjects Running test: itShouldReportAnErrorForNonJSErrorObjects
{ {
error : { error : {
code : -32602 code : -32000
message : errorObjectId is not a JS error object message : errorObjectId is not a JS error object
} }
id : <messageId> id : <messageId>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment