TIM-499: undeclared variable when logging an error

[TIM-499](https://edx-wiki.atlassian.net/browse/TIM-499)

@stephensanchez