Skip to content

Conversation

andy1li
Copy link
Member

@andy1li andy1li commented Sep 10, 2025

  • Updated stdout initialization to use writerStreaming for improved performance.
  • Changed usage message output from std.debug.print to stdout.print for consistency.
  • Removed unnecessary flush calls to streamline the code.

- Updated stdout initialization to use writerStreaming for improved performance.
- Changed usage message output from std.debug.print to stdout.print for consistency.
- Removed unnecessary flush calls to streamline the code.
@andy1li andy1li self-assigned this Sep 10, 2025

if (args.len < 3) {
std.debug.print("Usage: {s} <database_file_path> <command>\n", .{args[0]});
try stdout.print("Usage: {s} <database_file_path> <command>\n", .{args[0]});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Unhandled Error Bypasses Intended Exit Code

Changing the usage message from std.debug.print to try stdout.print introduces a new failure mode. If stdout.print fails, the try keyword causes the program to exit with an unhandled error, bypassing the intended std.process.exit(1). This can lead to an unexpected exit code and prevent the critical usage message from being displayed.

Additional Locations (3)

Fix in Cursor Fix in Web

@andy1li andy1li closed this Sep 19, 2025
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