error reporting almost works