Skip to content

Fix #996: preserve LiteException messages without format args#2756

Open
JKamsker wants to merge 2 commits into
litedb-org:devfrom
JKamsker:bug/996-liteexception-format
Open

Fix #996: preserve LiteException messages without format args#2756
JKamsker wants to merge 2 commits into
litedb-org:devfrom
JKamsker:bug/996-liteexception-format

Conversation

@JKamsker

Copy link
Copy Markdown
Collaborator

Fixes #996.

Summary

  • Avoids calling string.Format when LiteException formatting constructors receive no arguments.
  • Preserves diagnostic messages containing literal brace placeholders such as {0}.
  • Keeps existing formatting behavior unchanged when arguments are supplied.

TDD / verification

  • Added Issue996 tests for both formatting constructors with empty args.
  • Added coverage proving normal argument formatting still works.
  • Verified targeted issue tests, the Issues test namespace, and the full net8.0 test project.

Compatibility note

No on-disk format change. This is an exception-message/runtime behavior fix.

JKamsker and others added 2 commits June 10, 2026 22:24
Add Issue996 coverage for LiteException params constructors receiving no formatting arguments while the message contains brace placeholders. The tests capture the reported String.FormatException before changing production code and also verify normal argument formatting remains intact.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Avoid calling string.Format when LiteException formatting constructors receive a null or empty params array. This keeps literal brace placeholders in diagnostic messages from masking the original error with FormatException while preserving existing formatting when arguments are supplied.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d4657351-740e-4bda-88c2-fd2abe4fbea6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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