cloudflare / cloudflare/workerd

jsg::Lock::logWarning() and reportError() should send warnings/errors to tail workers

Open
#6,073 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
8.7k
Forks
739
Avg merge
2d 20h
Merged PRs (30d)
174

Description

In JSG isolate setup, we only install a logging handler if an inspector is attached or we're running in `--verbose` mode. This makes `jsg::Lock::logWarning()` only go to those sinks, and not tail Workers, which differs from `IoContext::logWarning()`'s behavior.

Relatedly, errors reported via `jsg::Lock::reportError()` are clearly intended to go to tail workers if they are installed, but we only install an error handler callback when an inspector is attached: https://github.com/cloudflare/workerd/blob/37dc327ecf58166645c6849f0961828a024fede8/src/workerd/io/worker.c%2B%2B#L1126-L1137

_Originally posted by @harrishancock in https://github.com/cloudflare/workerd/pull/6070#discussion_r2805058502_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.