aboutsummaryrefslogtreecommitdiff
path: root/frontend/Exception.cpp
blob: c852f0a2e422cd6ed2b65e31e24a7c1a15d45156 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <cstdarg>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#include "backend/String.h"

#include "Exception.h"

using namespace std;

const char * Exception::what() {
	return this->error.get();
}

Exception::Exception(const char * fmt, ...) {
	va_list args;
	va_start(args, fmt);
	this->error = unique_ptr<char>(strdup(String::va_fmt(args, fmt).c_str()));
	va_end(args);
}