1. @Injectable()
    2. export class SearchService {
    3. ...
    4. return this.http.get(`https://api.spotify.com/v1/dsds?q=${term}&type=artist`)
    5. .map(response => response.json())
    6. .catch(e => {
    7. if (e.status >== 500) {
    8. return cachedVersion();
    9. return Observable.throw(
    10. new Error(`${ e.status } ${ e.statusText }`)
    11. );
    12. }
    13. });
    14. }