-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror.cpp
69 lines (53 loc) · 1.24 KB
/
error.cpp
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// name: error.cpp
// version: 1.0
// description: handles error messages
// standard libraries
#include <string>
#include <iostream>
using namespace std;
// header file
#include "error.h"
/**
* @param error
* @param chain
* @constructor
*/
/*
Stratus.Prototypes.Error = function (error, chain) {
this.code = 'Internal';
this.message = 'No discernible data received.';
this.chain = [];
if (typeof error == 'string') {
this.message = error;
} else if (error && typeof error == 'object') {
_.extend(this, error);
}
this.chain.push(chain);
};
*/
// error handler
void error(int abort, int code, const char *message) {
/*
int tui = 0;
if (tui == 1) { tui::display(msg); }
else { perror(temp.c_str()); }
*/
/*
// declare variables
string temp;
// build error message
temp = "error %d: ";
temp += message;
temp += '\n';
// declare variables
char buffer[temp.size()];
// insert error code
sprintf(buffer, temp.c_str(), code);
// set data
temp = buffer;
// display message
perror(temp.c_str());
// handle abort
//if (abort == 1) { exit(1); }
*/
}