Skip to content

Commit aa2342c

Browse files
authored
Merge pull request #25 from nutdotnet/21-data-stale-response
Large changes to Socket/UPS, DATA-STALE error handling
2 parents 23ea925 + f608d51 commit aa2342c

File tree

5 files changed

+360
-286
lines changed

5 files changed

+360
-286
lines changed

WinNUT_V2/WinNUT-Client_Common/Common_Classes.vb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Public Class Nut_Exception
3636
Inherits System.ApplicationException
3737

3838
Public Property ExceptionValue As Nut_Exception_Value
39+
Public Property ProtocolError As NUTResponse
3940

4041
Public Sub New(ByVal Nut_Error_Lvl As Nut_Exception_Value)
4142
MyBase.New(StringEnum.GetStringValue(Nut_Error_Lvl))
@@ -45,6 +46,16 @@ Public Class Nut_Exception
4546
MyBase.New(StringEnum.GetStringValue(Nut_Error_Lvl) & Message, innerEx)
4647
ExceptionValue = Nut_Error_Lvl
4748
End Sub
49+
50+
''' <summary>
51+
''' Raise a Nut_Exception that resulted from an error as part of the NUT protocol.
52+
''' </summary>
53+
''' <param name="protocolError"></param>
54+
''' <param name="message"></param>
55+
Public Sub New(protocolError As NUTResponse, message As String)
56+
MyBase.New(message)
57+
Me.ProtocolError = protocolError
58+
End Sub
4859
End Class
4960

5061
Public Class Nut_Parameter

0 commit comments

Comments
 (0)