12
12
from aws_lambda_builders .path_resolver import PathResolver
13
13
from aws_lambda_builders .validator import RuntimeValidator
14
14
from 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
16
16
from aws_lambda_builders .actions import ActionFailedError
17
17
18
18
LOG = logging .getLogger (__name__ )
@@ -35,15 +35,18 @@ def sanitize(func):
35
35
@functools .wraps (func )
36
36
def wrapper (self , * args , ** kwargs ):
37
37
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 .
39
39
self .get_binaries ()
40
- # import ipdb
41
- # ipdb.set_trace()
42
40
for binary_path in self .binaries :
43
41
validator = binary_path .validator
44
42
exec_paths = binary_path .resolver .exec_paths if not binary_path .path_provided else binary_path .binary_path
45
43
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 ))
47
50
if valid_path :
48
51
binary_path .binary_path = valid_path
49
52
valid_paths .append (valid_path )
0 commit comments