Ejemplo n.º 1
0
        /// <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}"));
        }
Ejemplo n.º 2
0
 private static extern IntPtr uv_strerror(Uv_err_code err);
Ejemplo n.º 3
0
 private static extern IntPtr uv_err_name(Uv_err_code err);