0
오류 응답에 요청 페이로드를 기록하는 시나리오가 있지만 오류 개체에 기본 멤버보다 많은 정보가 포함될 수 없습니다.HttpClientModule (HTTPClient) 각도 4.3 이상의 오류 처리
페이로드에 대한 클로저 개체를 만드는 것과 관련된 제안은 무엇이며 오류 콜백에서 사용 하시겠습니까? HttpClient를
오류 응답에 요청 페이로드를 기록하는 시나리오가 있지만 오류 개체에 기본 멤버보다 많은 정보가 포함될 수 없습니다.HttpClientModule (HTTPClient) 각도 4.3 이상의 오류 처리
페이로드에 대한 클로저 개체를 만드는 것과 관련된 제안은 무엇이며 오류 콜백에서 사용 하시겠습니까? HttpClient를
나는 해결책을 발견 :
나는이 기존의 오류 클래스
export declare class HttpErrorResponse extends HttpResponseBase implements Error {
readonly name: string;
readonly message: string;
readonly error: any | null;
/**
* Errors are never okay, even when the status code is in the 2xx success range.
*/
readonly ok: boolean;
constructor(init: {
error?: any;
headers?: HttpHeaders;
status?: number;
statusText?: string;
url?: string;
});
}
각도 4.3의 새로운 구성원을 추가하는 의심한다. 오류 메시지를 가로 채서 액세스 페이로드를 추가하고 오류 개체로 전달해야합니다.
error.payload = request.data