Skip to content

Convert errors.js to TypeScript#483

Merged
wprzytula merged 2 commits into
scylladb:mainfrom
adespawn:ts-continues
Jun 19, 2026
Merged

Convert errors.js to TypeScript#483
wprzytula merged 2 commits into
scylladb:mainfrom
adespawn:ts-continues

Conversation

@adespawn

Copy link
Copy Markdown
Contributor

No description provided.

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 77188330-97d2-46a0-be3e-c231493cd4b6

📥 Commits

Reviewing files that changed from the base of the PR and between 4280bc0 and 41282e3.

📒 Files selected for processing (3)
  • lib/.gitignore
  • lib/errors.ts
  • main.d.ts

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.

@adespawn adespawn added the TS conversion It's time to say goodbye to JS type chaos label Jun 17, 2026
@adespawn adespawn requested a review from Copilot June 17, 2026 15:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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/errors from main.d.ts and remove the previously inlined errors namespace declarations.
  • Convert lib/errors to a typed TypeScript module with explicit exports.
  • Update lib/.gitignore to ignore generated errors.js / errors.d.ts build 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

  • NoHostAvailableError currently types innerErrors as a non-null object map, but at least one runtime call site passes null (e.g. lib/client.js throws new errors.NoHostAvailableError(null, ...)). With strict enabled, this makes the generated typings inconsistent with actual usage.
    lib/errors.ts:35
  • NoHostAvailableError's message parameter is typed as required, but the driver constructs this error without a message (see test/unit-not-supported/error-tests.js: new errors.NoHostAvailableError({})). This is a public API typing regression and also forces you to pass undefined through super(message). Make message optional and pass a safe default string to super.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@adespawn adespawn added this to the GA (optional) milestone Jun 18, 2026
@wprzytula wprzytula merged commit 4a25e7e into scylladb:main Jun 19, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

TS conversion It's time to say goodbye to JS type chaos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants