docs: setting context value inside an interceptor (#42699)
Usage of `get`/`set` methods should be done on a context object instead of a `HttpRequest` instance. PR Close #42699
This commit is contained in:
parent
8528073f6c
commit
f3965ff834
@ -14,7 +14,7 @@ import { NoopInterceptor } from './noop-interceptor';
|
||||
// #enddocregion interceptor-providers
|
||||
import { TrimNameInterceptor } from './trim-name-interceptor';
|
||||
import { UploadInterceptor } from './upload-interceptor';
|
||||
|
||||
import { RetryInterceptor } from './retry-interceptor';
|
||||
// #docregion interceptor-providers
|
||||
|
||||
/** Http interceptor providers in outside-in order */
|
||||
|
@ -39,7 +39,7 @@ export class RetryInterceptor implements HttpInterceptor {
|
||||
tap(null,
|
||||
() => {
|
||||
// An error has occurred, so increment this request's ERROR_COUNT.
|
||||
req.set(ERROR_COUNT, req.get(ERROR_COUNT) + 1);
|
||||
req.context.set(ERROR_COUNT, req.context.get(ERROR_COUNT) + 1);
|
||||
}),
|
||||
// #docregion reading-context
|
||||
// Retry the request a configurable number of times.
|
||||
|
Loading…
x
Reference in New Issue
Block a user