Build a :class:`ScriptError` from BiDi ``script.ExceptionDetails``.
(details: dict)
| 323 | |
| 324 | |
| 325 | def script_error_from_exception_details(details: dict) -> ScriptError: |
| 326 | """Build a :class:`ScriptError` from BiDi ``script.ExceptionDetails``.""" |
| 327 | frames = _stack_frames(details.get("stackTrace")) |
| 328 | top = frames[0] if frames else {} |
| 329 | return ScriptError( |
| 330 | message=details.get("text"), |
| 331 | source=top.get("url"), |
| 332 | line_number=details.get("lineNumber"), |
| 333 | column_number=details.get("columnNumber"), |
| 334 | stack_trace=_format_stack_trace(details.get("stackTrace")), |
| 335 | ) |
| 336 | |
| 337 | |
| 338 | def dom_mutation_from_payload(payload: dict) -> DomMutation: |
no test coverage detected