using System;
namespace DTT.Utils.Exceptions
{
///
/// The core exception class for RuntimeUtilityException exceptions used in the package.
///
public abstract class RuntimeUtilityException : Exception
{
#region Variables
#region Private
///
/// The prefixed message in front of any
///
///
private const string PREFIX = "[DTT] - [RuntimeUtilityException] ";
#endregion
#endregion
#region Constructors
///
/// Create a with the given message
/// to be preceded by the prefix.
///
/// The message to show.
public RuntimeUtilityException(string message) : base(Format(PREFIX, message)) { }
///
/// Create a with the given message
/// to be preceded by the prefix and inner exception.
///
/// The message to show.
/// The inner exception thrown.
public RuntimeUtilityException(string message, Exception innerException)
: base(Format(PREFIX, message), innerException)
{
}
#endregion
#region Methods
#region Private
///
/// Returns a formatted version of the given message using the .
///
/// The prefix value.
/// The message to be formatted.
/// The formatted message.
protected static string Format(string prefix, string message)
=> message.Insert(0, prefix);
#endregion
#endregion
}
}