-
Notifications
You must be signed in to change notification settings - Fork 0
/
error.d
49 lines (39 loc) · 1.42 KB
/
error.d
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
import std.process;
import std.stdio;
class ErrorHandlerClass
{
protected:
void ErrorHandler(int errorCode)
{
switch(errorCode)
{
case 0:
break;
//1: translateLanguage is incorrect
case 1:
writeln("Translate Language is incorrect.\n");
writeln("This error happens with following reasons\n");
writeln("1.The language is not supported 2.The language name is incorrect(refer to the README)\n");
execute("exit");
break;
//2: translatedLanguage is incorrect
case 2:
writeln("Translated Language is incorrect.\n");
writeln("This error happens with following reasons\n");
writeln("1.The language is not supported 2.the language Name is incorrect(refer to the README)\n");
execute("exit");
break;
//3: word is incorrect
case 3:
writeln("Word is incorrect.\n");
writeln("This error happens with following reasons\n");
writeln("1.The word is incorrect 2.The word does not exist\n");
execute("exit");
break;
default:
writeln("unknown error happened");
execute("exit");
break;
}
}
}