使用service过度error处理

This commit is contained in:
禾几海
2020-08-05 21:34:26 +08:00
parent 3ff80e5b54
commit 66d523e69c
5 changed files with 83 additions and 36 deletions

View File

@@ -0,0 +1,23 @@
import {Injectable, Injector} from '@angular/core';
import {Response} from '../class/HttpReqAndResp';
import {HttpService} from '../api/http/http.service';
@Injectable({
providedIn: 'root'
})
export class ErrorService {
constructor(private httpService: HttpService) {
}
public httpError(err: any) {
console.log('error=>', err)
// this.httpService.getSubscriptionQueue().map(a => a.unsubscribe())
}
public httpException(response: Response<any>) {
console.log('exception=>', response)
}
}