Refine and export the failure and error print functions.