Build a :class:`ScriptError` from raw ``log.entryAdded`` params.
(params: dict)
| 309 | |
| 310 | |
| 311 | def script_error_from_log_entry(params: dict) -> ScriptError: |
| 312 | """Build a :class:`ScriptError` from raw ``log.entryAdded`` params.""" |
| 313 | frames = _stack_frames(params.get("stackTrace")) |
| 314 | top = frames[0] if frames else {} |
| 315 | return ScriptError( |
| 316 | message=params.get("text"), |
| 317 | source=top.get("url"), |
| 318 | line_number=top.get("lineNumber"), |
| 319 | column_number=top.get("columnNumber"), |
| 320 | stack_trace=_format_stack_trace(params.get("stackTrace")), |
| 321 | timestamp=params.get("timestamp"), |
| 322 | ) |
| 323 | |
| 324 | |
| 325 | def script_error_from_exception_details(details: dict) -> ScriptError: |
no test coverage detected