/blog crashes with uncaught exception when the posts API is unreachable #310

Closed
opened 2026-07-01 20:45:50 +00:00 by spikerj · 2 comments
Owner

Found by the E2E anonymous walk (epic #307) after hardening the shell-mount assertion.

Symptom

When GET /api/blog/posts fails (API down, network error, CORS), /blog throws an uncaught client-side exception ([pageerror] k minified) instead of showing the error/retry UI.

Root cause

BlogListComponent.loadBlogPosts() calls this.blogService.getAllBlogPosts().subscribe() with no error handler. The service's tap({ error }) records the failure in its errorSignal (which drives the retry UI) but does not swallow it — so RxJS rethrows the error from the bare .subscribe() as an unhandled exception.

libraries/features/blog/src/lib/components/blog-list/blog-list-component.ts line ~69.

Fix

Subscribe with a no-op error callback — the service's errorSignal already drives the user-facing error state. Fix lands on the epic branch test/issue-307-e2e-full-coverage (spikersoft-angular PR #90).

Part of epic #307. Same defect class as #308 (/geography): API failure escaping as an unhandled rejection/exception and crashing a public page.

Found by the E2E anonymous walk (epic #307) after hardening the shell-mount assertion. ## Symptom When `GET /api/blog/posts` fails (API down, network error, CORS), `/blog` throws an uncaught client-side exception (`[pageerror] k` minified) instead of showing the error/retry UI. ## Root cause `BlogListComponent.loadBlogPosts()` calls `this.blogService.getAllBlogPosts().subscribe()` with **no error handler**. The service's `tap({ error })` records the failure in its `errorSignal` (which drives the retry UI) but does not swallow it — so RxJS rethrows the error from the bare `.subscribe()` as an unhandled exception. `libraries/features/blog/src/lib/components/blog-list/blog-list-component.ts` line ~69. ## Fix Subscribe with a no-op error callback — the service's `errorSignal` already drives the user-facing error state. Fix lands on the epic branch `test/issue-307-e2e-full-coverage` (spikersoft-angular PR #90). Part of epic #307. Same defect class as #308 (/geography): API failure escaping as an unhandled rejection/exception and crashing a public page.
spikerj added the bug label 2026-07-01 20:45:50 +00:00
Author
Owner

Fix pushed to spikersoft-angular PR #90 (commit ee58881 on test/issue-307-e2e-full-coverage): BlogListComponent.loadBlogPosts() now subscribes with a no-op error callback; the service's errorSignal already drives the user-facing error/retry UI, so the rethrow from the bare .subscribe() was pure crash with no UX value.

Anonymous walk passes /blog (25/25 overall). Will close when PR #90 merges.

Fix pushed to spikersoft-angular PR #90 (commit `ee58881` on `test/issue-307-e2e-full-coverage`): `BlogListComponent.loadBlogPosts()` now subscribes with a no-op error callback; the service's `errorSignal` already drives the user-facing error/retry UI, so the rethrow from the bare `.subscribe()` was pure crash with no UX value. Anonymous walk passes `/blog` (25/25 overall). Will close when PR #90 merges.
Author
Owner

Resolved in spikersoft-angular PR #90 (merged to master). BlogListComponent.loadBlogPosts() subscribes with a no-op error callback; the service's errorSignal drives the retry UI. Anonymous walk passes /blog. Closing.

Resolved in spikersoft-angular PR #90 (merged to `master`). `BlogListComponent.loadBlogPosts()` subscribes with a no-op error callback; the service's errorSignal drives the retry UI. Anonymous walk passes `/blog`. Closing.
Sign in to join this conversation.