Change ValueException base type to InvalidOperationException.