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 1515 * limitations under the License.
1616 */
1717
18+ import { AuthErrorCode } from '../core/errors' ;
19+ import { _createError } from '../core/util/assert' ;
20+
1821function getScriptParentElement ( ) : HTMLDocument | HTMLHeadElement {
1922 return document . getElementsByTagName ( 'head' ) ?. [ 0 ] ?? document ;
2023}
@@ -25,7 +28,11 @@ export function _loadJS(url: string): Promise<Event> {
2528 const el = document . createElement ( 'script' ) ;
2629 el . setAttribute ( 'src' , url ) ;
2730 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+ } ;
2936 el . type = 'text/javascript' ;
3037 el . charset = 'UTF-8' ;
3138 getScriptParentElement ( ) . appendChild ( el ) ;
You can’t perform that action at this time.
0 commit comments