return output on error