/*
 * ClbDebException.h
 *
 *  Created on: Jul 23, 2015
 *      Author: jjpalacios
 */

#ifndef UTILS_CLB_DEB_EXCEPTION_H_
#define UTILS_CLB_DEB_EXCEPTION_H_

#include <iostream>

namespace clbDEB {


/**
 * Class to manage exceptions
 *
 * Allows to customize text messages to be shown after an expcetion occurs
 *
 * @author jjpalacios
 *
 */
class ClbException : public std::exception {
protected:
	std::string cause;

 public:
	explicit ClbException(const std::string & errorMessage) : std::exception() {
		this->cause = "Fatal error (clb): " + errorMessage;
	}

	~ClbException() throw() {};

	//! Overload of method what to get the new message
	const char* what() const throw() {
		return this->cause.c_str();
	}
};

}

#endif /* UTILS_CLB_DEB_EXCEPTION_H_ */
