Skip to content

fix: use Exception instead of BaseException in atomic_json_write#1009

Open
hiSandog wants to merge 1 commit intoNousResearch:mainfrom
hiSandog:fix/use-exception-instead-of-baseexception
Open

fix: use Exception instead of BaseException in atomic_json_write#1009
hiSandog wants to merge 1 commit intoNousResearch:mainfrom
hiSandog:fix/use-exception-instead-of-baseexception

Conversation

@hiSandog
Copy link

Summary

This PR fixes a critical issue where BaseException was being caught instead of Exception in the atomic_json_write function.

Problem

Catching BaseException is generally a bad practice because it catches system-exiting exceptions like KeyboardInterrupt and SystemExit, which should typically propagate.

Changes

  • Changed exception handling from BaseException to Exception in atomic_json_write
  • This ensures proper exception handling without catching system-level exceptions

Impact

  • More correct exception handling
  • Prevents accidental suppression of KeyboardInterrupt and SystemExit

- BaseException catches KeyboardInterrupt and SystemExit which is not ideal
- Using Exception allows proper signal handling and graceful shutdown
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