-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathallError.c
34 lines (32 loc) · 913 Bytes
/
allError.c
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
#include "allError.h"
/* Funktionen printer fejl ud fra errorIndex */
void printError(int errorIndex, char* text) {
switch (errorIndex) {
case 100:
printf("Error 100: Unable to allocate space. ");
break;
case 202:
printf("Error 202: No corresponding date&time found for API data. ");
break;
case 401:
printf("Error 401: Input file is not formatted correctly. ");
break;
case 402:
printf("Error 402: Number can't be negative. ");
break;
case 403:
printf("Error 403: Number can't be negative or zero. ");
break;
case 404:
printf("Error 404: File not found. ");
break;
case 409:
printf("Error 409: File could not be closed. ");
break;
default:
printf("An unknown error occurred. ");
break;
}
printf("Error in %s\n", text);
exit(0);
}