Build a :class:`ScriptError` from raw ``log.entryAdded`` params.
(params: dict)
| 188 | |
| 189 | |
| 190 | def script_error_from_log_entry(params: dict) -> ScriptError: |
| 191 | """Build a :class:`ScriptError` from raw ``log.entryAdded`` params.""" |
| 192 | frames = _stack_frames(params.get("stackTrace")) |
| 193 | top = frames[0] if frames else {} |
| 194 | return ScriptError( |
| 195 | message=params.get("text"), |
| 196 | source=top.get("url"), |
| 197 | line_number=top.get("lineNumber"), |
| 198 | column_number=top.get("columnNumber"), |
| 199 | stack_trace=_format_stack_trace(params.get("stackTrace")), |
| 200 | timestamp=params.get("timestamp"), |
| 201 | ) |
| 202 | |
| 203 | |
| 204 | def script_error_from_exception_details(details: dict) -> ScriptError: |
no test coverage detected