Skip to content

Commit

Permalink
fix: allow line of stacktrace entry to be None
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-reimann committed May 4, 2024
1 parent b586aef commit f9e5319
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/safeds_runner/server/messages/_from_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class StacktraceEntry(BaseModel):
"""

file: str
line: int
line: int | None = None

model_config = ConfigDict(extra="forbid")

Expand Down
2 changes: 1 addition & 1 deletion src/safeds_runner/utils/_get_stacktrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def get_stacktrace_for_error(error: BaseException) -> list[StacktraceEntry]:
"""
frames = traceback.extract_tb(error.__traceback__)
return [
StacktraceEntry(file=frame.filename, line=int(frame.lineno))
StacktraceEntry(file=frame.filename, line=frame.lineno)
for frame in reversed(list(frames))
]

Expand Down

0 comments on commit f9e5319

Please sign in to comment.