use error object for raising exceptions