-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.C
More file actions
87 lines (67 loc) · 3.18 KB
/
error.C
File metadata and controls
87 lines (67 loc) · 3.18 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#include <sys/types.h>
#include <functional>
#include <iostream>
using namespace std;
#include "error.h"
void Error::print(Status status)
{
cerr << "Error: ";
switch(status) {
// no error
case OK: cerr << "no error"; break;
// File and DB errors
case BADFILEPTR: cerr << "bad file pointer"; break;
case BADFILE: cerr << "bad filename"; break;
case FILETABFULL: cerr << "open file table full"; break;
case FILEOPEN: cerr << "file open"; break;
case FILENOTOPEN: cerr << "file not open"; break;
case UNIXERR: cerr << "Unix error"; break;
case BADPAGEPTR: cerr << "bad page pointer"; break;
case BADPAGENO: cerr << "bad page number"; break;
case FILEEXISTS: cerr << "file exists already"; break;
// BufMgr and HashTable errors
case HASHTBLERROR: cerr << "hash table error"; break;
case HASHNOTFOUND: cerr << "hash entry not found"; break;
case BUFFEREXCEEDED: cerr << "buffer pool full"; break;
case PAGENOTPINNED: cerr << "page not pinned"; break;
case BADBUFFER: cerr << "buffer pool corrupted"; break;
case PAGEPINNED: cerr << "page still pinned"; break;
// Page class errors
case NOSPACE: cerr << "no space on page for record"; break;
case NORECORDS: cerr << "page is empty - no records"; break;
case ENDOFPAGE: cerr << "last record on page"; break;
case INVALIDSLOTNO: cerr << "invalid slot number"; break;
case INVALIDRECLEN: cerr << "specified record length <= 0";break;
// Heap file errors
case BADRID: cerr << "bad record id"; break;
case BADRECPTR: cerr << "bad record pointer"; break;
case BADSCANPARM: cerr << "bad scan parameter"; break;
case SCANTABFULL: cerr << "scan table full"; break;
case FILEEOF: cerr << "end of file encountered"; break;
case FILEHDRFULL: cerr << "heapfile hdear page is full"; break;
// Index errors
case BADINDEXPARM: cerr << "bad index parameter"; break;
case RECNOTFOUND: cerr << "no such record"; break;
case BUCKETFULL: cerr << "bucket full"; break;
case DIROVERFLOW: cerr << "directory is full"; break;
case NONUNIQUEENTRY: cerr << "nonunique entry"; break;
case NOMORERECS: cerr << "no more records"; break;
// Sorted file errors
case BADSORTPARM: cerr << "bad sort parameter"; break;
case INSUFMEM: cerr << "insufficient memory"; break;
// Catalog errors
case BADCATPARM: cerr << "bad catalog parameter"; break;
case RELNOTFOUND: cerr << "relation not in catalog"; break;
case ATTRNOTFOUND: cerr << "attribute not in catalog"; break;
case NAMETOOLONG: cerr << "name too long"; break;
case ATTRTOOLONG: cerr << "attributes too long"; break;
case DUPLATTR: cerr << "duplicate attribute names"; break;
case RELEXISTS: cerr << "relation exists already"; break;
case NOINDEX: cerr << "no index exists"; break;
case ATTRTYPEMISMATCH: cerr << "attribute type mismatch"; break;
case TMP_RES_EXISTS: cerr << "temp result already exists"; break;
case INDEXEXISTS: cerr << "index exists already"; break;
default: cerr << "undefined error status: " << status;
}
cerr << endl;
}