Convert errors.js to TypeScript#483
Conversation
|
Warning Review limit reached
More reviews will be available in 24 minutes and 55 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
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. Comment |
There was a problem hiding this comment.
Pull request overview
This PR converts the driver’s errors implementation to TypeScript and updates the public TypeScript entrypoint (main.d.ts) to re-export the errors module instead of inlining error type declarations.
Changes:
- Re-export
./lib/errorsfrommain.d.tsand remove the previously inlinederrorsnamespace declarations. - Convert
lib/errorsto a typed TypeScript module with explicit exports. - Update
lib/.gitignoreto ignore generatederrors.js/errors.d.tsbuild artifacts.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| main.d.ts | Switches from an inlined errors namespace to export * as errors from "./lib/errors". |
| lib/errors.ts | Adds TypeScript typings and converts CommonJS exports to ES exports for driver error classes. |
| lib/.gitignore | Ignores generated outputs for the new TS-based errors module. |
Comments suppressed due to low confidence (2)
lib/errors.ts:28
NoHostAvailableErrorcurrently typesinnerErrorsas a non-null object map, but at least one runtime call site passesnull(e.g.lib/client.jsthrowsnew errors.NoHostAvailableError(null, ...)). Withstrictenabled, this makes the generated typings inconsistent with actual usage.
lib/errors.ts:35NoHostAvailableError'smessageparameter is typed as required, but the driver constructs this error without a message (seetest/unit-not-supported/error-tests.js:new errors.NoHostAvailableError({})). This is a public API typing regression and also forces you to passundefinedthroughsuper(message). Makemessageoptional and pass a safe default string tosuper.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.