This repository was archived by the owner on Jul 29, 2024. It is now read-only.
File tree 1 file changed +17
-10
lines changed
1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -429,16 +429,23 @@ export class ElementArrayFinder extends WebdriverWebElement {
429
429
*/
430
430
applyAction_ ( actionFn : Function ) : ElementArrayFinder {
431
431
let callerError = new Error ( ) ;
432
- let actionResults = this . getWebElements ( )
433
- . then ( ( arr : any ) => {
434
- return webdriver . promise . all ( arr . map ( actionFn ) ) ;
435
- } )
436
- . then ( null , ( e : Error ) => {
437
- let noSuchErr = ( e as any ) ;
438
- noSuchErr . stack =
439
- noSuchErr . stack + ( callerError as any ) . stack ;
440
- throw noSuchErr ;
441
- } ) ;
432
+ let actionResults =
433
+ this . getWebElements ( )
434
+ . then ( ( arr : any ) => {
435
+ return webdriver . promise . all ( arr . map ( actionFn ) ) ;
436
+ } )
437
+ . then ( null , ( e : Error ) => {
438
+ let noSuchErr : any ;
439
+ let stack : string ;
440
+ if ( e instanceof Error ) {
441
+ noSuchErr = ( e as any )
442
+ noSuchErr . stack = noSuchErr . stack + ( callerError as any ) . stack ;
443
+ } else {
444
+ noSuchErr = ( new Error ( e . toString ( ) ) as any ) ;
445
+ noSuchErr . stack = ( callerError as any ) . stack ;
446
+ }
447
+ throw noSuchErr ;
448
+ } ) ;
442
449
return new ElementArrayFinder (
443
450
this . browser_ , this . getWebElements , this . locator_ , actionResults ) ;
444
451
}
You can’t perform that action at this time.
0 commit comments