Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
AlibException.cpp 856 B
/*
 * AlibException.cpp
 *
 * Created on: Apr 1, 2013
 * Author: Martin Zak
 */

#include "AlibException.h"

#include <cstdlib>
#include <iostream>
#include <stdexcept>
#include <sstream>

#include <execinfo.h>
#include "../std/simpleStacktrace.h"

namespace exception {

AlibException::AlibException ( ) {
	this->backtrace = std::simpleStacktrace();

	this->whatMessage += this->backtrace;
}

AlibException::AlibException ( const std::string & cause ) : AlibException() {
	this->cause = cause;
	
	this->whatMessage += this->cause;
}

AlibException::~AlibException ( ) noexcept {

}

const char * AlibException::what ( ) const noexcept {
	return whatMessage.c_str ( );
}

const std::string & AlibException::getCause ( ) const {
	return cause;
}

const std::string & AlibException::getBacktrace ( ) const {
	return backtrace;
}

} /* namespace exception */