API 1 Methods (that have not been deprecated and renamed to use API 2 → Exceptions) should continue to set .LastErrorCode.
It’s still there, just doesn’t AutoComplete any more.
API 1:
FolderItem.CopyFileTo
FolderItem.MoveFileTo
API 2 (according to Documentation):
FolderItem.CreateAsFolder → no Info, should continue using ErrorCodes
FolderItem.Delete (continues with ErrorCode)-> replaced by API 2: FolderItem.Remove (Exception)
FolderItem.CopyFileTo → ErrorCodes
FolderItem.MoveFileTo → Exception (according to documentation, not tested)
Hmm… Existing functionality in API 1 should NOT be changed.
FolderItem.MoveFileTo should continue setting ErrorCode…?
But what is it actually doing…? To me this seems to be quite a mess right now with FolderItem.
I hope this gets looked at and sorted in 2019r2.1.
Check both for Exceptions and .LastErrorCode?
To be really sure…:
(if it hasn’t existed there before; if your to-be-moved-file is no longer in its old location; …)
I’d like to mark both posts of @Jürg Otter and @Rick Araujo as Answer, but now marked Rick’s because in the future this will/should be the correct answer.
Why?
The intent is that existing methods (API 1) keep working with error codes while new ones (API 2) throw exceptions.
It’s just that there currently aren’t new API 2 methods for FolderItem’s Move/Copy.
And it’s a bit unfortunate that .LastErrorCode doesn’t AutoComplete for FolderItem, even if it’s still being used by some of FolderItem’s Methods.
One could/should file a Feedback about that.