mean-expert-official / loopback-sdk-builder

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

fix: read property error of undefined when DOMException occured #623

Open dreamdevil00 opened 5 years ago

dreamdevil00 commented 5 years ago

What type of issue are you creating?

What version of this module are you using?

Write other if any:

Please add a description for your issue:

I passed a wrong baseUrl to config accidently

const baseUrl = window.location.host;
LoopBackConfig.setBaseUrl(baseUrl);

when I call api, an DOMException error occured, and report the error as title. The DOMException error message is

DOMException: Failed to execute 'open' on 'XMLHttpRequest': Invalid URL

Related code: LINK

we should make sure errorResponse.error exists, PTAL