Skip to content

Commit

Permalink
Allow overriding of JsonApiDatastore's error handler in derived class…
Browse files Browse the repository at this point in the history
…es (#11)

Change visibility of handleError method from private to protected to allow overriding with custom error handlers in derived classes
  • Loading branch information
floh1111 authored and ghidoz committed Sep 19, 2016
1 parent a91c421 commit 98a300b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/services/json-api-datastore.service.ts
Expand Up @@ -2,6 +2,7 @@ import * as _ from 'underscore';
import { Injectable } from '@angular/core';
import { Http, Headers, RequestOptions, Response } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import { ErrorObservable } from 'rxjs/observable/ErrorObservable';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
import 'rxjs/add/observable/throw';
Expand Down Expand Up @@ -141,7 +142,7 @@ export class JsonApiDatastore {
return model;
}

private handleError(error: any) {
protected handleError(error: any) {
let errMsg: string = (error.message) ? error.message :
error.status ? `${error.status} - ${error.statusText}` : 'Server error';
console.error(errMsg);
Expand Down

0 comments on commit 98a300b

Please sign in to comment.