aws-lambda-chaos-injection icon indicating copy to clipboard operation
aws-lambda-chaos-injection copied to clipboard

Improve error message if SSM parameter does not exist

Open alexcasalboni opened this issue 6 years ago • 2 comments

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?

alexcasalboni avatar Aug 20 '19 01:08 alexcasalboni

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.

adhorn avatar Aug 20 '19 04:08 adhorn

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).

alexcasalboni avatar Aug 20 '19 05:08 alexcasalboni