mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Migrate from window.console to LogService
This commit is contained in:
@@ -15,10 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService } from 'ng2-alfresco-core';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Response } from '@angular/http';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { AlfrescoApiService, LogService } from 'ng2-alfresco-core';
|
||||
import { BpmUserModel } from '../models/bpm-user.model';
|
||||
/**
|
||||
*
|
||||
@@ -29,7 +29,8 @@ import { BpmUserModel } from '../models/bpm-user.model';
|
||||
@Injectable()
|
||||
export class BpmUserService {
|
||||
|
||||
constructor(private alfrescoJsApi: AlfrescoApiService) {
|
||||
constructor(private alfrescoJsApi: AlfrescoApiService,
|
||||
private logService: LogService) {
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -54,7 +55,7 @@ export class BpmUserService {
|
||||
private handleError(error: Response) {
|
||||
// in a real world app, we may send the error to some remote logging infrastructure
|
||||
// instead of just logging it to the console
|
||||
console.error(error);
|
||||
this.logService.error(error);
|
||||
return Observable.throw(error || 'Server error');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user