Fix typo:  error_message did not have access to variables request or e

The logger statement does not have access to the variables 'request' or 'e', so it needs to be moved into the rescue block.