|
|
This is the base class for exceptions related to Meyer's contract theory. EContractError provides a constructor that allows more precise debugging info, such as the line number and the filename from where the error was raised.
EContractError () |
Default constructor. Creates an EContractError object with the message "Contract violation error".
EContractError (const char* fileName, int line, const char* condition,int contract) |
Construct a new EContractError object from environment data on the location of the contract violation. This constructor is typically used with __FILE__ and __LINE__ compiler defines. The parameters must not be 0.
Parameters:
fileName | Name of the file where the error occured. |
line | Line where the error occured. |
condition | condition that failed (in a string format). |
contract | Either of the following constants: PreCondition, PostCondition, Invariant or Assertion. |
QString message () |
Get the error message of the EContractError object. This method is overloaded to provide meaningful error messages from the values obtained at construction time (file and line of error, condition that was violated, type of contract that was violated).
Returns: QString An error message representing data in the EContractError object.