print error status and output on errors