Open Bug 1792426 Opened 2 years ago Updated 2 years ago

Decide how to handle error return values with a null stack

Categories

(Remote Protocol :: WebDriver BiDi, task, P3)

task

Tracking

(Not tracked)

People

(Reporter: jdescottes, Unassigned)

References

Details

(Whiteboard: [webdriver:backlog])

Until Bug 1791715 is fixed, we sometimes run into uncaught exceptions for which we don't have any stacktrace.

This leads to failures in the code which generates our "exception details": https://searchfox.org/mozilla-central/rev/6c1a6e3263c2cae45b285b489ef340d944102262/remote/webdriver-bidi/modules/windowglobal/script.jsm#84-94

We will attempt to lift the limitation of 50 stacktraces from Bug 1791715.

But in general we need to decide what to do when the return value from executeInGlobal/executeInGlobalWithBindings has a "throw" property but no "stack". Is this a legitimate situation and should we just null-check before we use "stack"? Or is this not supposed to happen and should we throw a clear error for the user?

Hi Arai!

From a spidermonkey perspective, beyond the special case of Bug 1791715, could we expect all return values which have a "throw" property to also have a non-null "stack"? Or is this a valid situation that we should handle cleanly on our side?

Flags: needinfo?(arai.unmht)

The stack can be empty, for example when:

So, I think the callsite of executeInGlobal should expect the stack being null, and in general there should be null-check before access.

Flags: needinfo?(arai.unmht)

Thanks for the info Arai! We might have to update the spec for BiDi at https://w3c.github.io/webdriver-bidi/#type-script-ExceptionDetails to accept a missing stackTrace.

Priority: -- → P3
Whiteboard: [webdriver:backlog]

(In reply to Julian Descottes [:jdescottes] from comment #3)

Thanks for the info Arai! We might have to update the spec for BiDi at https://w3c.github.io/webdriver-bidi/#type-script-ExceptionDetails to accept a missing stackTrace.

stackTrace can actually be an empty array, the line and column number should be 0 in that case.

You need to log in before you can comment on or make changes to this bug.