59 lines
2.1 KiB
C#
59 lines
2.1 KiB
C#
using System;
|
|
|
|
namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol.Exceptions
|
|
{
|
|
/// <summary>
|
|
/// Holds all errors can occur on the request protocol
|
|
/// </summary>
|
|
public class RequestProtocolException : Exception
|
|
{
|
|
/// <summary>
|
|
/// Exception occurred on this command
|
|
/// </summary>
|
|
public Object Command;
|
|
/// <summary>
|
|
/// Exception occurred while receiving this data
|
|
/// </summary>
|
|
public Object ReceivedData;
|
|
|
|
/// <summary>
|
|
/// Error is interpreted and has a define error code
|
|
/// if its not null is Genesis.Protocols.Request.Const.ConfigExErrors
|
|
/// </summary>
|
|
public Int32? ConfigExErrorCode;
|
|
/// <summary>
|
|
/// Error is interpreted and has a define error code
|
|
/// if its not null is Genesis.Protocols.Request.Const.HighLevelError
|
|
/// </summary>
|
|
public Int32? HighLevelErrorCode;
|
|
|
|
/// <summary>
|
|
/// Ctor with only message
|
|
/// </summary>
|
|
/// <param name="message">error message</param>
|
|
public RequestProtocolException(String message) : base(message)
|
|
{
|
|
}
|
|
/// <summary>
|
|
/// Ctor with message and <see cref="Command"/>
|
|
/// </summary>
|
|
/// <param name="message">error message</param>
|
|
/// <param name="command"><see cref="Command"/></param>
|
|
public RequestProtocolException(String message, Object command) : base(message)
|
|
{
|
|
Command = command;
|
|
ReceivedData = null;
|
|
}
|
|
/// <summary>
|
|
/// Ctor with message, <see cref="Command"/> and <see cref="ReceivedData"/>
|
|
/// </summary>
|
|
/// <param name="message">error message</param>
|
|
/// <param name="command"><see cref="Command"/></param>
|
|
/// <param name="receivedData"><see cref="ReceivedData"/> </param>
|
|
public RequestProtocolException(String message, Object command, Object receivedData) : base(message)
|
|
{
|
|
Command = command;
|
|
ReceivedData = receivedData;
|
|
}
|
|
}
|
|
} |