Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this.serviceName.methodName().catch(err => {
- // Handle error here
- console.log("Something went wrong with the request, please try again.");
- // re-throw error so you can catch it when subscribing, fallback to generic error code
- return Observable.throw(err.message.toUpperCase() || 'API_ERROR');
- }).subscribe((res) => {
- console.log(res);
- });
- this.serviceName.methodName().subscribe((res) => {
- console.log(res);
- },
- error=>{
- console.log(error);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement