(error: Error)
| 256 | // a Javascript error. It emits the error via the Observable error channel as |
| 257 | // a HttpErrorResponse. |
| 258 | const onError = (error: Error) => { |
| 259 | cleanup(); |
| 260 | |
| 261 | // Wrap the error in a HttpErrorResponse. |
| 262 | observer.error( |
| 263 | new HttpErrorResponse({ |
| 264 | error, |
| 265 | status: 0, |
| 266 | statusText: 'JSONP Error', |
| 267 | url, |
| 268 | }), |
| 269 | ); |
| 270 | }; |
| 271 | |
| 272 | // Subscribe to both the success (load) and error events on the <script> tag, |
| 273 | // and add it to the page. |
no test coverage detected