IsErrInvalidState should also unwrap errors