refactor report error