libNuML 1.1.1
Library for reading / writing NuML documents
NUMLError Class Reference

contains all error information collected More...

#include <NUMLError.h>

Inheritance diagram for NUMLError:

Public Member Functions

 NUMLError (const unsigned int errorId=0, const unsigned int level=NUML_DEFAULT_LEVEL, const unsigned int version=NUML_DEFAULT_VERSION, const std::string &details="", const unsigned int line=0, const unsigned int column=0, const unsigned int severity=LIBNUML_SEV_ERROR, const unsigned int category=LIBNUML_CAT_NUML)
 Creates a new NUMLError to report that something occurred during NUML processing. More...
 
 NUMLError (const NUMLError &orig)
 Copy constructor; creates a copy of this NUMLError. More...
 
virtual NUMLErrorclone () const
 clone function More...
 

Protected Member Functions

virtual std::string stringForSeverity (unsigned int code) const
 
virtual std::string stringForCategory (unsigned int code) const
 

Detailed Description

contains all error information collected

Constructor & Destructor Documentation

◆ NUMLError() [1/2]

NUMLError::NUMLError ( const unsigned int  errorId = 0,
const unsigned int  level = NUML_DEFAULT_LEVEL,
const unsigned int  version = NUML_DEFAULT_VERSION,
const std::string &  details = "",
const unsigned int  line = 0,
const unsigned int  column = 0,
const unsigned int  severity = LIBNUML_SEV_ERROR,
const unsigned int  category = LIBNUML_CAT_NUML 
)

Creates a new NUMLError to report that something occurred during NUML processing.

When a libNUML operation on NUML content results in a warning, error or other diagnostic, the issue is reported as an NUMLError object. NUMLError objects have identification numbers to indicate the nature of the exception. The argument errorId to this constructor can be (but does not have to be) a value from this

If the error identifier errorId is a number greater than 99999, the NUMLError class assumes the error was generated from another part of the software and does not do additional filling in of values beyond the default in the constructor itself. This allows NUMLError to serve as a base class for other errors, such as for user-defined validation rules (see Validator). Callers should fill in all the parameters with suitable values if generating errors with codes greater than 99999 to make maximum use of the NUMLError facilities.

Please see the top of the documentation for NUMLError for a longer discussion of the possible error codes, their meanings, and their applicability to different combinations of Level+Version of NUML.

Parameters
errorIdan unsigned int, the identification number of the error.
levelthe NUML Level of the NUML model
versionthe NUML Version within the Level of the NUML model
detailsa string containing additional details about the error. If the error code in errorId is one that is recognized by NUMLError, the given message is appended to a predefined message associated with the given code. If the error code is not recognized, the message is stored as-is as the text of the error.
linean unsigned int, the line number at which the error occured.
columnan unsigned int, the column number at which the error occured.
severityan integer indicating severity of the error.
categoryan integer indicating the category to which the error belongs.

@docnote The native C++ implementation of this method defines a default argument value. In the documentation generated for different libNUML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libNUML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.

◆ NUMLError() [2/2]

NUMLError::NUMLError ( const NUMLError orig)

Copy constructor; creates a copy of this NUMLError.

Member Function Documentation

◆ clone()

NUMLError * NUMLError::clone ( ) const
virtual

clone function

◆ stringForCategory()

std::string NUMLError::stringForCategory ( unsigned int  code) const
protectedvirtual

◆ stringForSeverity()

std::string NUMLError::stringForSeverity ( unsigned int  code) const
protectedvirtual

The documentation for this class was generated from the following files: