catch exceptions in `appInvocation` (#78)

The `appInvocation` template in `confutils` is used while showing help,
e.g., before quitting. To ensure that `quit` actually happens, it can't
raise exceptions. Fix that by falling back to `""` on `OSError`.
This commit is contained in:
Etan Kissling 2023-06-08 15:30:46 +02:00 committed by GitHub
parent 50f744d821
commit 6c3566850d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -96,7 +96,10 @@ when defined(nimscript):
else:
template appInvocation: string =
getAppFilename().splitFile.name
try:
getAppFilename().splitFile.name
except OSError:
""
when noColors:
const