1212from aws_lambda_builders .path_resolver import PathResolver
1313from aws_lambda_builders .validator import RuntimeValidator
1414from aws_lambda_builders .registry import DEFAULT_REGISTRY
15- from aws_lambda_builders .exceptions import WorkflowFailedError , WorkflowUnknownError
15+ from aws_lambda_builders .exceptions import WorkflowFailedError , WorkflowUnknownError , MisMatchRuntimeError
1616from aws_lambda_builders .actions import ActionFailedError
1717
1818LOG = logging .getLogger (__name__ )
@@ -35,15 +35,18 @@ def sanitize(func):
3535 @functools .wraps (func )
3636 def wrapper (self , * args , ** kwargs ):
3737 valid_paths = []
38- # NOTE: we need to access workflow object to get the validator .
38+ # NOTE: we need to access binaries to get paths and resolvers, before validating .
3939 self .get_binaries ()
40- # import ipdb
41- # ipdb.set_trace()
4240 for binary_path in self .binaries :
4341 validator = binary_path .validator
4442 exec_paths = binary_path .resolver .exec_paths if not binary_path .path_provided else binary_path .binary_path
4543 for executable_path in exec_paths :
46- valid_path = validator .validate (executable_path )
44+ valid_path = None
45+ try :
46+ valid_path = validator .validate (executable_path )
47+ except MisMatchRuntimeError as ex :
48+ LOG .debug ("Invalid executable for %s at %s" ,
49+ binary_path .binary , executable_path , exc_info = str (ex ))
4750 if valid_path :
4851 binary_path .binary_path = valid_path
4952 valid_paths .append (valid_path )
0 commit comments