@@ -50,34 +50,34 @@ using WindowsKillLibrary::SIGNAL_TYPE_CTRL_C;
5050using WindowsKillLibrary::SIGNAL_TYPE_CTRL_BREAK;
5151
5252try {
53- sendSignal(signal_pid, signal_type);
54- std::cout << "Signal sent successfuly. type: " << signal_type << " | pid: " << signal_pid << "\n";
55- }
56- catch (const std::invalid_argument& exception) {
57- if (strcmp(exception.what(), "ESRCH") == 0) {
58- std::cout << "Error: Pid dosen't exist." << std::endl;
59- }
60- else if(strcmp(exception.what(), "EINVAL") == 0){
61- std::cout << "Error: Invalid signal type." << std::endl;
62- }
63- else {
64- std::cout << "InvalidArgument: windows-kill-library:" << exception.what() << std::endl;
65- }
66- }
67- catch (const std::system_error& exception) {
68- std::cout << "SystemError " << exception.code() << ": " << exception.what() << std::endl;
69- }
70- catch (const std::runtime_error& exception) {
71- if (strcmp(exception.what(), "EPERM") == 0) {
72- std::cout << "Not enough permission to send the signal." << std::endl;
73- }
74- else {
75- std::cout << "RuntimeError: windows-kill-library:" << exception.what() << std::endl;
76- }
77- }
78- catch (const std::exception& exception) {
79- std::cout << "Error: windows-kill-library:" << exception.what() << std::endl;
80- }
53+ sendSignal(signal_pid, signal_type);
54+ std::cout << "Signal sent successfuly. type: " << signal_type << " | pid: " << signal_pid << "\n";
55+ }
56+ catch (const std::invalid_argument& exception) {
57+ if (strcmp(exception.what(), "ESRCH") == 0) {
58+ std::cout << "Error: Pid dosen't exist." << std::endl;
59+ }
60+ else if(strcmp(exception.what(), "EINVAL") == 0){
61+ std::cout << "Error: Invalid signal type." << std::endl;
62+ }
63+ else {
64+ std::cout << "InvalidArgument: windows-kill-library:" << exception.what() << std::endl;
65+ }
66+ }
67+ catch (const std::system_error& exception) {
68+ std::cout << "SystemError " << exception.code() << ": " << exception.what() << std::endl;
69+ }
70+ catch (const std::runtime_error& exception) {
71+ if (strcmp(exception.what(), "EPERM") == 0) {
72+ std::cout << "Not enough permission to send the signal." << std::endl;
73+ }
74+ else {
75+ std::cout << "RuntimeError: windows-kill-library:" << exception.what() << std::endl;
76+ }
77+ }
78+ catch (const std::exception& exception) {
79+ std::cout << "Error: windows-kill-library:" << exception.what() << std::endl;
80+ }
8181```
8282
8383### WindowsKillLibrary::SIGNAL_TYPE_CTRL_BREAK
0 commit comments