add query and parameters in exceptions

preserve traceback