ghy
Alejandro Acuña
2025-03-12 26319e4c5bfbee722c15b8e7ccca9b6127bb1cb8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Exception.cpp: implementation of the Exception class.
//
//////////////////////////////////////////////////////////////////////
 
#include <stdarg.h>
#include <stdio.h>
 
#include "Exception.h"
 
 
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
 
Exception::Exception(int errorCode, const char * str_, ...)
{
    this->errorCode = errorCode;
 
    va_list arglist;
    va_start(arglist, str_);
    _vsnprintf(errorMessage, MAX_EXCEPTION_LENGTH-1, str_, arglist);
    va_end(arglist); 
    errorMessage[MAX_EXCEPTION_LENGTH-1] = '\0';
}
 
Exception::~Exception()
{
}
 
int
Exception::ErrorCode()
{
    return errorCode;
}
 
char *
Exception::ErrorMessage()
{
    return errorMessage;
}