Migrate from window.console to LogService

This commit is contained in:
Denys Vuika
2017-01-05 21:06:30 +00:00
parent 2d98a04f87
commit d42f41ec00
106 changed files with 1177 additions and 1171 deletions

View File

@@ -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');
}