switched to an inline conditional and catch Exception on repr(request)
as per code review by mattbasta