tests errors are set properly