Handle empty bitcoincli path gracefully instead of crashing

When bclock.conf has an empty bitcoincli path, catch the PermissionError
and redirect to introINIT() with a helpful error message instead of
crashing with 'Fatal error: Permission denied'.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
GaltRanch 2026-04-01 13:47:26 -03:00
parent 88b1609100
commit cc9a5e236e

View file

@ -7407,6 +7407,14 @@ def main():
except KeyboardInterrupt:
print("\n")
sys.exit(0)
except PermissionError as e:
if str(e).endswith("''"):
show_error("Bitcoin CLI path is not configured. Please set it up.")
logger.error("Empty bitcoincli path in bclock.conf")
introINIT()
else:
logger.error("Fatal error: %s", e)
sys.exit(101)
except Exception as e:
logger.error("Fatal error: %s", e)
sys.exit(101)