How can I wrap a boto.storage_uri() call in python so I can handle possible exceptions?
How can I wrap a boto.storage_uri() call in python so I can handle possible
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The first question is what exceptions is this call likely to generate? You do not want to make a blanket exception handler in any language. You should first take a look at the Boto documentation to see if it documents the exceptions you might see from a given call, but if not I would first try:
Or log the exception (with the logging package
exceptionmethod), but either way you want to take note of what types of exceptions you see while you’re testing and whether you should handle any of them specially. You also may want to review the Python Tutorial section on Exceptions and Errors.