Difference between revisions of "Dice/DiceException"

From DiceRoller Documentation
 
Line 16: Line 16:
 
== Constructors ==
 
== Constructors ==
 
{| class="wikitable"
 
{| class="wikitable"
! style="width: 5em"
+
! style="width: 5em" |
 
! Name !! Description
 
! Name !! Description
 
|-
 
|-

Latest revision as of 17:50, 12 April 2017

The exception that is thrown whenever an error happens while evaluating a dice expression. This is used to signify an issue with the expression itself rather than any programming error.

  • Namespace: Dice
  • Assembly: DiceRoller (in DiceRoller.dll)

Inheritance Hierarchy

System.Object

System.Exception
Dice.DiceException

Syntax

public class DiceException : Exception

Constructors

Name Description
DiceException(DiceErrorCode) Constructs a DiceException for the given DiceErrorCode.
DiceException(DiceErrorCode, Object) Constructs a DiceException for the given DiceErrorCode using the given object as its parameter.
DiceException(DiceErrorCode, Exception) Constructs a DiceException for the given DiceErrorCode and the given Exception as its inner exception.
DiceException(DiceErrorCode, Object, Exception) Constructs a DiceException for the given DiceErrorCode using the given object as its parameter and the given Exception as its inner exception.

Properties

Name Description
ErrorCode Gets the error that this exception was thrown for.

Remarks

Represents an error with the user-inputted dice expression. These errors should generally be made visible to the user in some fashion to let them know to adjust their dice expression. Errors which indicate bugs in the library or are programmer errors do not use this exception type. The ErrorCode is exposed in the event that you wish to expose different error messages to the end user without needing to resort to string parsing to transform the built-in error messages to customized ones.

In addition to the properties listed above, all properties, methods, etc. from Exception are also exposed.

Thread Safety

Any public static members of this type are thread safe. Any instance members are not guaranteed to be thread safe.