pass request object when throwing an exception