Priority: High
Several Notion integration points use .catch(() => ({})), which turns real failures (auth errors, rate limits, network) into empty objects. Downstream code then reads missing fields and produces cryptic "cannot read property of undefined" errors far from the original failure.
Locations
Suggested fix
Introduce a NotionError extends Error class that preserves status/cause, throw it from the catch handlers, and let callers decide how to recover. Log at the catch site with enough context to diagnose.
Priority: High
Several Notion integration points use
.catch(() => ({})), which turns real failures (auth errors, rate limits, network) into empty objects. Downstream code then reads missing fields and produces cryptic "cannot read property of undefined" errors far from the original failure.Locations
Suggested fix
Introduce a
NotionError extends Errorclass that preserves status/cause, throw it from the catch handlers, and let callers decide how to recover. Log at the catch site with enough context to diagnose.