Skip to content

Commit abdade9

Browse files
arturovtthePunderWoman
authored andcommitted
refactor(common): drop httpResource error message (#61570)
Drops `httpResource` error message in production and replaces with an error code. PR Close #61570
1 parent 88c70eb commit abdade9

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

packages/common/http/src/resource.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@ import {
1414
linkedSignal,
1515
assertInInjectionContext,
1616
signal,
17-
ResourceStatus,
1817
computed,
19-
Resource,
20-
WritableSignal,
2118
ResourceStreamItem,
2219
type ValueEqualityFn,
20+
ɵRuntimeError,
21+
ɵRuntimeErrorCode,
2322
} from '@angular/core';
24-
import {Subscription} from 'rxjs';
23+
import type {Subscription} from 'rxjs';
2524

2625
import {HttpRequest} from './request';
2726
import {HttpClient} from './client';
@@ -363,7 +362,12 @@ class HttpResourceImpl<T>
363362
},
364363
complete: () => {
365364
if (resolve) {
366-
send({error: new Error('Resource completed before producing a value')});
365+
send({
366+
error: new ɵRuntimeError(
367+
ɵRuntimeErrorCode.RESOURCE_COMPLETED_BEFORE_PRODUCING_VALUE,
368+
ngDevMode && 'Resource completed before producing a value',
369+
),
370+
});
367371
}
368372
abortSignal.removeEventListener('abort', onAbort);
369373
},

0 commit comments

Comments
 (0)