Skip to content

Overriding handleError #267

@mangicapra

Description

@mangicapra

"angular2-jsonapi": "^8.2.1"

In readme is stated 'It's also possible to handle errors for all requests by overriding handleError(error: any): Observable in the datastore.'.

So i'm interested how can i achieve this behaviour? This is auth datastore and should it be possible to override it in here.

const config: DatastoreConfig = {
baseUrl: ${environment.baseUrl}/auth,
models: {
login: Login,
refresh: Refresh,
},
};
@Injectable({
providedIn: 'root',
})
@JsonApiDatastoreConfig(config)
export class DatastoreService extends JsonApiDatastore {
constructor(public http: HttpClient) {
super(http);
}
}

Thanks :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions