Sitelet https://github.com/angular/angular/pull/70259
Skip to content

docs: add NG0991 error page and document rxResource's completion contract - #70259

Open
arturovt wants to merge 1 commit into
angular:mainfrom
arturovt:docs/ng0991-resource-completed-error-page
Open

docs: add NG0991 error page and document rxResource's completion contract#70259
arturovt wants to merge 1 commit into
angular:mainfrom
arturovt:docs/ng0991-resource-completed-error-page

Conversation

@arturovt

Copy link
Copy Markdown
Contributor

RESOURCE_COMPLETED_BEFORE_PRODUCING_VALUE had no guide, no JSDoc on RxResourceOptions.stream, and — since the code was positive rather than negative — could never get an auto-linked docs page even if one existed. Flip it to -991, add the NG0991 reference page, and document the "stream must emit a value or an error before completing" requirement on stream's JSDoc and in the RxJS interop guide.

Also documents and tests that an unguarded template read of an errored resource's .value() propagates to the global ErrorHandler, and recommends guarding with .hasValue() as defense in depth.

@pullapprove
pullapprove Bot requested a review from kirjs August 18, 2026 19:24
@angular-robot angular-robot Bot added the area: docs Related to the documentation label Aug 18, 2026
@ngbot ngbot Bot added this to the Backlog milestone Aug 18, 2026
Comment thread adev/src/content/reference/errors/NG0991.md
@JeanMeche
JeanMeche requested review from JeanMeche and removed request for kirjs August 18, 2026 21:27
@arturovt
arturovt force-pushed the docs/ng0991-resource-completed-error-page branch from bc82e97 to 62fde36 Compare August 19, 2026 05:42

In all other ways, `rxResource` behaves like and provides the same APIs as `resource` for specifying parameters, reading values, checking loading state, and examining errors.

### The stream must produce a value or an error

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think it's worthy of overloading the guide with this.

…ract

RESOURCE_COMPLETED_BEFORE_PRODUCING_VALUE had no guide, no JSDoc on
RxResourceOptions.stream, and — since the code was positive rather
than negative — could never get an auto-linked docs page even if one
existed. Flip it to -991, add the NG0991 reference page, and document
the "stream must emit a value or an error before completing"
requirement on stream's JSDoc and in the RxJS interop guide.

Also documents and tests that an unguarded template read of an
errored resource's .value() propagates to the global ErrorHandler,
and recommends guarding with .hasValue() as defense in depth.

httpResource can throw the same error, but for a different reason:
its internal request Observable isn't something app code writes
directly, so an empty completion there is almost always an
HttpInterceptor swallowing the response (catchError(() => EMPTY))
rather than a stream authored in the resource() call itself. The page
covers both APIs with guidance matched to what's actually going on
for each.
@arturovt
arturovt force-pushed the docs/ng0991-resource-completed-error-page branch from 62fde36 to 785ab66 Compare August 25, 2026 13:03
@arturovt
arturovt requested a review from JeanMeche August 25, 2026 13:03
@pullapprove
pullapprove Bot requested review from crisbeto and kirjs August 25, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Related to the documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants