Skip to content

Harden flash crash runner with input validation and structured error handling#2

Open
Pushpenderrathore wants to merge 7 commits intoGabagool2-2:mainfrom
Pushpenderrathore:main
Open

Harden flash crash runner with input validation and structured error handling#2
Pushpenderrathore wants to merge 7 commits intoGabagool2-2:mainfrom
Pushpenderrathore:main

Conversation

@Pushpenderrathore
Copy link

@Pushpenderrathore Pushpenderrathore commented Feb 16, 2026

Summary

This improves the robustness and safety of the flash crash strategy runner by adding input validation and enhancing runtime error handling.

Changes

  • Added strict private key format validation before bot initialization
  • Improved CLI error handling with clearer user-facing messages
  • Separated debug and non-debug logging behavior
  • Added structured exception handling for async runtime
  • Prevented cryptographic initialization errors from leaking stack traces in normal mode

Improvement

The previous implementation allowed cryptographic errors and stack traces to surface directly to the user, which reduced usability and made debugging less controlled. This update ensures:

  • Fail-fast validation of critical configuration
  • Cleaner CLI behavior
  • More predictable runtime failure handling
  • Improved developer debugging via --debug flag

Impact

No changes to trading logic.
Only improves CLI safety and reliability.

Testing

  • Verified valid private key path works correctly
  • Verified invalid key fails fast with clear message
  • Verified debug mode prints full traceback
  • Verified non-debug mode suppresses stack traces

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant