You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HRESULT.ToString() throws System.OverflowException: Value was either too large or too small for a UInt32.
I tried updating our Project references Vanara.PInvoke.CldApi (3.4.17) and Vanara.PInvoke.SearchApi (3.4.17) to 4.0.1.
After updating the above mentioned exception is thrown when cloud API calls fail with a Win32 error code which was not the case before.
ToString() should succeed and return HRESULT_FROM_WIN32(ERROR_CLOUD_FILE_NOT_UNDER_SYNC_ROOT): The operation is only supported on files under a cloud sync root.
Repro is very simple by creating a HRESULT object from the error code returned by the Cloud API directly:
staticvoidMain(string[]args){HRESULThRESULT=HRESULT.HRESULT_FROM_WIN32(Win32Error.ERROR_CLOUD_FILE_NOT_UNDER_SYNC_ROOT);//Should print: HRESULT_FROM_WIN32(ERROR_CLOUD_FILE_NOT_UNDER_SYNC_ROOT): The operation is only supported on files under a cloud sync root.//Throws: HRESULT.ToString() throws `System.OverflowException: Value was either too large or too small for a UInt32.`Console.WriteLine(""+hRESULT);Console.Read();}
The text was updated successfully, but these errors were encountered:
pdupont1
changed the title
ErrorHelper.GetErrorMessage throws System.OverflowException: Value was either too large or too small for a UInt32.
ErrorHelper.GetErrorMessage throws System.OverflowException
May 16, 2024
I think this is fixed. I've tested your condition without failure with the pre-4.0.2 build. It should be available to test shortly from the AppVeyor feed (see homepage).
Describe the bug and how to reproduce
HRESULT.ToString() throws
System.OverflowException: Value was either too large or too small for a UInt32.
I tried updating our Project references Vanara.PInvoke.CldApi (3.4.17) and Vanara.PInvoke.SearchApi (3.4.17) to 4.0.1.
After updating the above mentioned exception is thrown when cloud API calls fail with a Win32 error code which was not the case before.
Stacktrace:
What code is involved
Vanara.PInvoke.Shared 4.0.1
.NET Runtime 8.0.5
Expected behavior
ToString() should succeed and return
HRESULT_FROM_WIN32(ERROR_CLOUD_FILE_NOT_UNDER_SYNC_ROOT): The operation is only supported on files under a cloud sync root.
Repro is very simple by creating a HRESULT object from the error code returned by the Cloud API directly:
The text was updated successfully, but these errors were encountered: