/// <summary> /// Createsz the error exception with the name and description. /// </summary> /// <param name="error">The error code.</param> /// <returns>The built exception with details of the error code.</returns> private static Exception CreateError(Uv_err_code error) { IntPtr ptr = uv_err_name(error); string name = ptr != IntPtr.Zero ? Marshal.PtrToStringAnsi(ptr) : null; ptr = uv_strerror(error); string description = ptr != IntPtr.Zero ? Marshal.PtrToStringAnsi(ptr) : null; return(new Exception($"Error: {error}, name: {name}, description: {description}")); }
private static extern IntPtr uv_strerror(Uv_err_code err);
private static extern IntPtr uv_err_name(Uv_err_code err);