Skip to content

feat: add contextual qjson errors#127

Merged
membphis merged 1 commit into
mainfrom
codex/issue-124-error-context
May 31, 2026
Merged

feat: add contextual qjson errors#127
membphis merged 1 commit into
mainfrom
codex/issue-124-error-context

Conversation

@membphis
Copy link
Copy Markdown
Collaborator

Summary

  • add qjson_format_error and qjson_doc_last_error_offset to expose contextual error messages through the C ABI
  • track access failure offsets on documents and format Lua parse/access errors with snippets, expected types, and byte offsets
  • improve EOF/unclosed-container parse reporting for eager grammar/depth errors while preserving unclosed-string EOF errors

Closes #124

Tests

  • cargo test --release --test ffi_parse_error_offsets
  • cargo test --features test-panic --release
  • cargo test --release --no-default-features
  • make lint
  • PATH="$HOME/.luarocks/bin:$PATH" make test

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 31, 2026

Warning

Review limit reached

@membphis, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 38 minutes and 40 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8622b3e1-0a68-4e96-875b-71d8b2e5c56d

📥 Commits

Reviewing files that changed from the base of the PR and between 613b5aa and ba7f46d.

📒 Files selected for processing (11)
  • include/qjson.h
  • lua/qjson.lua
  • lua/qjson/lib.lua
  • lua/qjson/table.lua
  • src/doc.rs
  • src/error.rs
  • src/ffi.rs
  • tests/ffi_parse_error_offsets.rs
  • tests/lua/basic_spec.lua
  • tests/lua/lazy_table_spec.lua
  • tests/lua/options_spec.lua
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/issue-124-error-context

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.

@membphis membphis merged commit 7035a7d into main May 31, 2026
16 checks passed
@membphis membphis deleted the codex/issue-124-error-context branch May 31, 2026 15:53
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.

改进 JSON 解析/访问错误信息,包含出错上下文

1 participant