-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommandError.hpp
More file actions
35 lines (29 loc) · 835 Bytes
/
CommandError.hpp
File metadata and controls
35 lines (29 loc) · 835 Bytes
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
//
// CommandError.hpp
// ncc
//
// Created by yuki on 2022/04/21.
//
#ifndef CommandError_hpp
#define CommandError_hpp
#include <string>
#include <iostream>
struct CommandError {
enum class Kind {
NotAvailable,
ChildNotCreated,
UnkownTermination
};
Kind kind;
std::string message;
static auto notAvailable() -> CommandError {
return CommandError{ Kind::NotAvailable, "A shell is not available on the system." };
}
static auto childNotCreated() -> CommandError {
return CommandError{ Kind::ChildNotCreated, "A child process could not be created." };
}
static auto unkownTermination() -> CommandError {
return CommandError{ Kind::UnkownTermination, "A child process terminated by unkown reason." };
}
};
#endif /* CommandError_hpp */