Skip to content

Commit

Permalink
Instead of crashing if cited non-.lua path not found, show a warning …
Browse files Browse the repository at this point in the history
…and try the next parser (mitigate issue #30).
  • Loading branch information
Poikilos committed Sep 16, 2023
1 parent 828aa02 commit 0227ed8
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions outputinspector/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1340,10 +1340,28 @@ def lineInfo(self, info, originalLine, actualJump, actualJumpLine,
if not os.path.isfile(tryAbsPath):
if ".lua" in line and not ".lua]" in line:
raise RuntimeError(
"Path '%s' not found in `%s`"
"Path '%s' not found"
" in `%s`"
% (tryPath, line)
)
raise FileNotFoundError(tryAbsPath)
echo0(
"Warning: A path cited"
" by the log wasn't"
" found: '%s' in `%s`"
" so the format will"
" be skipped: linedef=%s"
% (tryAbsPath,
pformat(line),
linedef)
)
# raise FileNotFoundError(
# "Not found: %s in `%s`"
# % (pformat(tryAbsPath),
# pformat(line))
# ) # ^ must format, otherwise
# if it is blank, it won't
# show :( (will show the
# variable name instead)
# else avoid crashing on line
# that doesn't have a file:
# "2023-08-13 09:51:19: ERROR[AsyncWorker-0]:
Expand Down

0 comments on commit 0227ed8

Please sign in to comment.