-
Notifications
You must be signed in to change notification settings - Fork 26.6k
Closed as not planned
Labels
area: common/httpIssues related to HTTP and HTTP ClientIssues related to HTTP and HTTP Clientbreaking changesfeatureIssue that requests a new featureIssue that requests a new featurefeature: insufficient votesLabel to add when the not a sufficient number of votes or comments from unique authorsLabel to add when the not a sufficient number of votes or comments from unique authors
Milestone
Description
Which @angular/* package(s) are relevant/related to the feature request?
common/http
(
angular/packages/common/http/src/response.ts
Line 323 in ba0ca42
export class HttpErrorResponse extends HttpResponseBase implements Error { |
Description
There is a potential issue where the program tries to access properties of null without proper type inference
Programmer should infer type for this:
error: (res: HttpErrorResponse) => {
// check if res extends ApiErrorResponse interface
if (this.apiValidator.isApiErrorResponse(res)) {
this.onError(res.error.errorCode);
}
},
Proposed solution
Change
readonly error: any | null;
to
readonly error: undefined;
Alternatives considered
No alternatives
HereIsNils, nifiro, CSharpFiasco and 5im0n
Metadata
Metadata
Assignees
Labels
area: common/httpIssues related to HTTP and HTTP ClientIssues related to HTTP and HTTP Clientbreaking changesfeatureIssue that requests a new featureIssue that requests a new featurefeature: insufficient votesLabel to add when the not a sufficient number of votes or comments from unique authorsLabel to add when the not a sufficient number of votes or comments from unique authors