better error reporting for unreachable errors