Skip to content

Commit

Permalink
chore: keep error handling for the future possible usage (#921)
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuCocoa authored Jul 21, 2024
1 parent d2302a3 commit 2f90739
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions WebDriverAgentLib/Utilities/FBW3CActionsSynthesizer.m
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,14 @@ @implementation FBW3CActionsSynthesizer
});

NSArray<NSDictionary<NSString *, id> *> *actionItems = [actionDescription objectForKey:FB_KEY_ACTIONS];
if (nil == actionItems || 0 == actionItems.count) {
NSString *description = [NSString stringWithFormat:@"It is mandatory to have at least one item defined for each action. Action with id '%@' contains none", actionId];
if (error) {
*error = [[FBErrorBuilder.builder withDescription:description] build];
}
return nil;
}

FBW3CKeyItemsChain *chain = [[FBW3CKeyItemsChain alloc] init];
NSArray<NSDictionary<NSString *, id> *> *processedItems = [self preprocessedActionItemsWith:actionItems];
for (NSDictionary<NSString *, id> *actionItem in processedItems) {
Expand Down Expand Up @@ -762,6 +770,14 @@ @implementation FBW3CActionsSynthesizer
}

NSArray<NSDictionary<NSString *, id> *> *actionItems = [actionDescription objectForKey:FB_KEY_ACTIONS];
if (nil == actionItems || 0 == actionItems.count) {
NSString *description = [NSString stringWithFormat:@"It is mandatory to have at least one gesture item defined for each action. Action with id '%@' contains none", actionId];
if (error) {
*error = [[FBErrorBuilder.builder withDescription:description] build];
}
return nil;
}

FBW3CGestureItemsChain *chain = [[FBW3CGestureItemsChain alloc] init];
NSArray<NSDictionary<NSString *, id> *> *processedItems = [self preprocessedActionItemsWith:actionItems];
for (NSDictionary<NSString *, id> *actionItem in processedItems) {
Expand Down

0 comments on commit 2f90739

Please sign in to comment.