我在日志中记录了这个错误,我尝试使用其他设备重现该错误,但是我从未能够做到。
{“headers”:{“normalizedNames”:{},“lazyUpdate”:null,“headers”:{}},“status”:0,“statusText”:“Unknown Error”,“url”:null,“ok”:false,“name”:“HttpErrorResponse”,“message”:“Http failure response for (unknown url): 0 Unknown Error”,“error”:{“isTrusted”:true}}
此错误来自此函数,该函数调用google api:
return new Promise((resolve, reject) => {
this.http
.post(
“https://automl.googleapis.com/v1beta1/projects/XXXXX/locations/us-central1/models/XXXXXXXXXX:predict”,
file,
{
headers: {“Authorization”:"Bearer "+accessToken}
}
)
.timeout(600000)
.map(res => res)
.toPromise()
.then(
//call then instead of subscribe to form the promise chain.
data => {
resolve(data);
},
err => {
reject(err);
this.utilsService.registerEvent(err,userId,version)
}
);
});
}
我不知道如何解决它以及如何复制它。每天会产生10或15个错误。有谁能够帮助我?谢谢!