mean-expert-official / loopback-sdk-builder

Tool for auto-generating Software Development Kits (SDKs) for LoopBack
Other
399 stars 178 forks source link

ErrorHandler throws TypeError #575

Open Eslem opened 6 years ago

Eslem commented 6 years ago

What type of issue are you creating?

What version of this module are you using?

Write other if any: 2.2.0

When there is no response from the serve throws the error: error.json is not a function, i think the error handler should be:

public handleError(error: Response): any {
    return Observable.throw(error.json? error.json().error : 'Server error');
 }

instead of:

public handleError(error: Response): any {
    return Observable.throw(error.json().error || 'Server error');
  }