aws-lambda-chaos-injection
aws-lambda-chaos-injection copied to clipboard
Improve error message if SSM parameter does not exist
Printing the whole e object is not very useful here.
It'd show something like ssm_cache.cache.InvalidParameterError: chaoslambda.config is invalid. ['chaoslambda.config'] - {}.
By the way, I wouldn't raise an ssm_cache.cache.InvalidParameterError here. Maybe it's better if we also define a proper error class in chaos_lambda?
Why not raising the original ssm_cache error? This is in my opinion the right thing to do. Adding layers makes it harder to debug.
Imho, because the users of chaos_lambda shouldn't need to be aware of ssm_cache under the hood. Here we are catching InvalidParameterError and could raise a InvalidChaosConfigError (which is what the user needs to know, eventually with some additional information about how to fix the problem).