Pm_GetErrorText() private method

private Pm_GetErrorText ( PortMidiSharp.MidiErrorType errnum ) : string
errnum PortMidiSharp.MidiErrorType
return string
        public int Read(byte[] buffer, int index, int length)
        {
            var gch = GCHandle.Alloc(buffer);

            try
            {
                var ptr  = Marshal.UnsafeAddrOfPinnedArrayElement(buffer, index);
                int size = PortMidiMarshal.Pm_Read(stream, ptr, length);
                if (size < 0)
                {
                    throw new MidiException((MidiErrorType)size, PortMidiMarshal.Pm_GetErrorText((PmError)size));
                }
                return(size * 4);
            }
            catch
            {
                return(0);
            }
            finally
            {
                gch.Free();
            }
        }
        public void Write(MidiEvent[] buffer, int index, int length)
        {
            var gch = GCHandle.Alloc(buffer);

            try
            {
                var ptr = Marshal.UnsafeAddrOfPinnedArrayElement(buffer, index);
                var ret = PortMidiMarshal.Pm_Write(stream, ptr, length);
                if (ret != PmError.NoError)
                {
                    throw new MidiException(ret, String.Format("Failed to write messages : {0}", PortMidiMarshal.Pm_GetErrorText((PmError)ret)));
                }
            }
            finally
            {
                gch.Free();
            }
        }
        public void WriteSysEx(PmTimestamp when, byte[] sysex)
        {
            var ret = PortMidiMarshal.Pm_WriteSysEx(stream, when, sysex);

            if (ret != PmError.NoError)
            {
                throw new MidiException(ret, String.Format("Failed to write sysex message : {0}", PortMidiMarshal.Pm_GetErrorText((PmError)ret)));
            }
        }
        public void Write(PmTimestamp when, MidiMessage msg)
        {
            var ret = PortMidiMarshal.Pm_WriteShort(stream, when, msg);

            if (ret != PmError.NoError)
            {
                throw new MidiException(ret, String.Format("Failed to write message {0} : {1}", msg.Value, PortMidiMarshal.Pm_GetErrorText((PmError)ret)));
            }
        }