File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
packages-exp/auth-exp/src/platform_browser Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 15
15
* limitations under the License.
16
16
*/
17
17
18
+ import { AuthErrorCode } from '../core/errors' ;
19
+ import { _createError } from '../core/util/assert' ;
20
+
18
21
function getScriptParentElement ( ) : HTMLDocument | HTMLHeadElement {
19
22
return document . getElementsByTagName ( 'head' ) ?. [ 0 ] ?? document ;
20
23
}
@@ -25,7 +28,11 @@ export function _loadJS(url: string): Promise<Event> {
25
28
const el = document . createElement ( 'script' ) ;
26
29
el . setAttribute ( 'src' , url ) ;
27
30
el . onload = resolve ;
28
- el . onerror = reject ;
31
+ el . onerror = e => {
32
+ const error = _createError ( AuthErrorCode . INTERNAL_ERROR ) ;
33
+ error . customData = e as unknown as Record < string , unknown > ;
34
+ reject ( error ) ;
35
+ } ;
29
36
el . type = 'text/javascript' ;
30
37
el . charset = 'UTF-8' ;
31
38
getScriptParentElement ( ) . appendChild ( el ) ;
You can’t perform that action at this time.
0 commit comments