It's good practice to limit the lines in a `try` / `except` statement as much as possible. Not only simplifies code but reduces the risk of capturing an exception caused from a line you didn't expect. 

In this case the only line that can raise `BadStatusCodeError` is line 63. Let's wrap only that line within a `try`/`except` statement.