Skip to content

Commit

Permalink
Instead of crashing if cited non-.lua path not found, show verbose in…
Browse files Browse the repository at this point in the history
…fo and try the next parser (mitigate issue #30).
  • Loading branch information
Poikilos committed Sep 16, 2023
1 parent 828aa02 commit 0bf7655
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions outputinspector/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1340,10 +1340,30 @@ 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)
echo1(
"INFO: A path cited"
" by the log wasn't"
" found: '%s' in `%s`"
" so the format will"
" be skipped: tryPath=%s"
" in linedef=%s"
% (tryAbsPath,
pformat(line),
tryPath,
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 0bf7655

Please sign in to comment.