Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
aliirdn committed Feb 15, 2018
1 parent e5c03d6 commit 9e5fbaf
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions windows-kill-library/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,34 +50,34 @@ using WindowsKillLibrary::SIGNAL_TYPE_CTRL_C;
using WindowsKillLibrary::SIGNAL_TYPE_CTRL_BREAK;
try {
sendSignal(signal_pid, signal_type);
std::cout << "Signal sent successfuly. type: " << signal_type << " | pid: " << signal_pid << "\n";
}
catch (const std::invalid_argument& exception) {
if (strcmp(exception.what(), "ESRCH") == 0) {
std::cout << "Error: Pid dosen't exist." << std::endl;
}
else if(strcmp(exception.what(), "EINVAL") == 0){
std::cout << "Error: Invalid signal type." << std::endl;
}
else {
std::cout << "InvalidArgument: windows-kill-library:" << exception.what() << std::endl;
}
}
catch (const std::system_error& exception) {
std::cout << "SystemError " << exception.code() << ": " << exception.what() << std::endl;
}
catch (const std::runtime_error& exception) {
if (strcmp(exception.what(), "EPERM") == 0) {
std::cout << "Not enough permission to send the signal." << std::endl;
}
else {
std::cout << "RuntimeError: windows-kill-library:" << exception.what() << std::endl;
}
}
catch (const std::exception& exception) {
std::cout << "Error: windows-kill-library:" << exception.what() << std::endl;
}
sendSignal(signal_pid, signal_type);
std::cout << "Signal sent successfuly. type: " << signal_type << " | pid: " << signal_pid << "\n";
}
catch (const std::invalid_argument& exception) {
if (strcmp(exception.what(), "ESRCH") == 0) {
std::cout << "Error: Pid dosen't exist." << std::endl;
}
else if(strcmp(exception.what(), "EINVAL") == 0){
std::cout << "Error: Invalid signal type." << std::endl;
}
else {
std::cout << "InvalidArgument: windows-kill-library:" << exception.what() << std::endl;
}
}
catch (const std::system_error& exception) {
std::cout << "SystemError " << exception.code() << ": " << exception.what() << std::endl;
}
catch (const std::runtime_error& exception) {
if (strcmp(exception.what(), "EPERM") == 0) {
std::cout << "Not enough permission to send the signal." << std::endl;
}
else {
std::cout << "RuntimeError: windows-kill-library:" << exception.what() << std::endl;
}
}
catch (const std::exception& exception) {
std::cout << "Error: windows-kill-library:" << exception.what() << std::endl;
}
```

### WindowsKillLibrary::SIGNAL_TYPE_CTRL_BREAK
Expand Down

0 comments on commit 9e5fbaf

Please sign in to comment.