Skip to content

fix(v8engine): handle nil logger and module download errors#253

Open
denisraison wants to merge 1 commit into
gost-dom:mainfrom
denisraison:fix/v8-script-context-errors
Open

fix(v8engine): handle nil logger and module download errors#253
denisraison wants to merge 1 commit into
gost-dom:mainfrom
denisraison:fix/v8-script-context-errors

Conversation

@denisraison
Copy link
Copy Markdown

Problem

Two latent issues in V8ScriptContext I ran into while wiring up a test harness:

  1. DownloadModule calls InstantiateModule even when the prior download returned an error, causing a nil-deref on the failed result.
  2. logger() dereferences host.logger unconditionally, so any caller that hasn't set one up panics.

Fix

  • Return early from DownloadModule when the download errored.
  • Fall back to slog.Default() when host.logger is nil.

Two-line-ish changes, no API surface affected.

Two latent issues in V8ScriptContext:

1. DownloadModule called InstantiateModule even when the prior download
   returned an error, causing a nil-deref. Return the download error.
2. logger() dereferenced host.logger unconditionally. Fall back to the
   default logger when nil so callers don't need to set one up.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 15, 2026

Warning

Rate limit exceeded

@denisraison has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 59 minutes and 53 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 13ba3b3e-d7b7-4643-a983-1dad4dbc1d80

📥 Commits

Reviewing files that changed from the base of the PR and between 40953c9 and 7ee89ef.

📒 Files selected for processing (1)
  • scripting/v8engine/script_context.go

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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