Observer Handling


#1

Hello,

I want that when val == 1 an error should be thrown and I want to catch it in the error block of the same subscribe, but with throw its not working. Please help!

  this.rest.readRoles().subscribe(val => {
      if (val.id = 1) {
throw 'Error: id, 1'
      }
    }, error => {
//Catch Here
    });