set error reporting based on debuging