1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
9 #ifndef anna_core_RuntimeException_hpp
10 #define anna_core_RuntimeException_hpp
15 #include <anna/core/Exception.hpp>
20 Excepcion lanzada durante la ejecucion de un caso de prueba al comprobar
21 que alguna situacion es anomala.
23 class RuntimeException : public Exception {
28 @param text Texto con la explicacion de la excepcion.
29 @param fromFile Fichero en el que se provoco la situacion de error.
30 @param fromLine Linea del fichero en la que se provoco la situacion de error.
32 RuntimeException(const char* text, const char* fromFile, const int fromLine) :
33 Exception(text, "RuntimeException", fromFile, fromLine),
39 @param text Texto con la explicacion de la excepcion.
40 @param fromFile Fichero en el que se provoco la situacion de error.
41 @param fromLine Linea del fichero en la que se provoco la situacion de error.
43 explicit RuntimeException(const std::string& text, const char* fromFile, const int fromLine) :
44 Exception(text.c_str(), "RuntimeException", fromFile, fromLine),
50 @param fileName Nombre del fichero sobre el que actuabamos
51 \param xerrno Numero de error (errno) generado por la ultima operacion de IO o SO.
52 @param fromFile Fichero en el que se provoco la situacion de error.
53 @param fromLine Linea del fichero en la que se provoco la situacion de error.
55 explicit RuntimeException(const std::string& fileName, const int xerrno, const char* fromFile, const int fromLine) :
56 Exception(std::string(fileName + ": " + strerror(xerrno)).c_str(), "RuntimeException", fromFile, fromLine),
61 @param other Instancia de la que obtener la informacion.
63 RuntimeException(const RuntimeException& other) : Exception(other),
64 a_errno(other.a_errno)
69 @param other Instancia de la que obtener la informacion.
71 RuntimeException(const Exception& other) : Exception(other),
76 @return El numero de error con el que se inicio la excepcion.
78 int getErrorNumber() const throw() { return a_errno; }