@@ -249,15 +249,15 @@ class process
249249
250250 if (static_cast <bool >(options & process_options::grab_stdin))
251251 if (!CreatePipe (&stdin_rd, &stdin_wr, &security_attributes, 0 ) || !SetHandleInformation (stdin_wr, HANDLE_FLAG_INHERIT, 0 ))
252- throw std::runtime_error{" Can not create stdin pipe. " + get_error_message ()};
252+ throw std::runtime_error{" Failed to create stdin pipe. " + get_error_message ()};
253253
254254 if (static_cast <bool >(options & process_options::grab_stdout))
255255 if (!CreatePipe (&stdout_rd, &stdout_wr, &security_attributes, 0 ) || !SetHandleInformation (stdout_rd, HANDLE_FLAG_INHERIT, 0 ))
256- throw std::runtime_error{" Can not create stdout pipe. " + get_error_message ()};
256+ throw std::runtime_error{" Failed to create stdout pipe. " + get_error_message ()};
257257
258258 if (static_cast <bool >(options & process_options::grab_stderr))
259259 if (!CreatePipe (&stderr_rd, &stderr_wr, &security_attributes, 0 ) || !SetHandleInformation (stderr_rd, HANDLE_FLAG_INHERIT, 0 ))
260- throw std::runtime_error{" Can not create stderr pipe. " + get_error_message ()};
260+ throw std::runtime_error{" Failed to create stderr pipe. " + get_error_message ()};
261261 #endif
262262
263263 args.insert (std::begin (args), path);
@@ -326,7 +326,7 @@ class process
326326
327327 PROCESS_INFORMATION process_info{};
328328 if (!CreateProcessW (std::data (native_path), null_or_data (args_str), nullptr , nullptr , TRUE , 0 , nullptr , null_or_data (native_working_directory), &startup_info, &process_info))
329- throw std::runtime_error{" Can not create process. " + get_error_message ()};
329+ throw std::runtime_error{" Failed to create process. " + get_error_message ()};
330330
331331 m_id = static_cast <id>(process_info.dwProcessId );
332332 m_handle = process_info.hProcess ;
@@ -401,10 +401,10 @@ class process
401401 assert (joinable () && " nes::process::join() called with joinable() returning false." );
402402
403403 if (WaitForSingleObject (m_handle, INFINITE))
404- throw std::runtime_error{" Can not join the process. " + get_error_message ()};
404+ throw std::runtime_error{" Failed to join the process. " + get_error_message ()};
405405
406406 if (!GetExitCodeProcess (m_handle, reinterpret_cast <DWORD*>(&m_return_code)))
407- throw std::runtime_error{" Can not get the return code of the process. " + get_error_message ()};
407+ throw std::runtime_error{" Failed to get the return code of the process. " + get_error_message ()};
408408
409409 close_process ();
410410 }
@@ -421,7 +421,7 @@ class process
421421
422422 DWORD result = WaitForSingleObject (m_handle, 0 );
423423 if (result == WAIT_FAILED)
424- throw std::runtime_error{" Can not get the state of the process. " + get_error_message ()};
424+ throw std::runtime_error{" Failed to get the state of the process. " + get_error_message ()};
425425
426426 return result == WAIT_TIMEOUT;
427427 }
@@ -490,7 +490,7 @@ class process
490490 out_path.resize (required_size);
491491
492492 if (!MultiByteToWideChar (CP_UTF8, 0 , std::data (path), std::size (path), std::data (out_path), std::size (out_path)))
493- throw std::runtime_error{" Can not convert the path to wide." };
493+ throw std::runtime_error{" Failed to convert the path to wide." };
494494
495495 return out_path;
496496 }
@@ -561,7 +561,7 @@ inline std::string working_directory()
561561 path.resize (required_size);
562562
563563 if (!WideCharToMultiByte (CP_UTF8, 0 , std::data (native_path), std::size (native_path), std::data (path), std::size (path), nullptr , nullptr ))
564- throw std::runtime_error{" Can not convert the path to UTF-8." };
564+ throw std::runtime_error{" Failed to convert the path to UTF-8." };
565565
566566 return path;
567567}
@@ -573,7 +573,7 @@ inline bool change_working_directory(const std::string& path)
573573 native_path.resize (required_size);
574574
575575 if (!MultiByteToWideChar (CP_UTF8, 0 , std::data (path), std::size (path), std::data (native_path), std::size (native_path)))
576- throw std::runtime_error{" Can not convert the path to wide." };
576+ throw std::runtime_error{" Failed to convert the path to wide." };
577577
578578 return SetCurrentDirectoryW (std::data (native_path));
579579}
@@ -799,13 +799,13 @@ class process
799799 impl::auto_handle stderr_fd[2 ]{};
800800
801801 if (static_cast <bool >(options & process_options::grab_stdin) && pipe (reinterpret_cast <int *>(stdin_fd)))
802- throw std::runtime_error{" Can not create stdin pipe. " + std::string{strerror (errno)}};
802+ throw std::runtime_error{" Failed to create stdin pipe. " + std::string{strerror (errno)}};
803803
804804 if (static_cast <bool >(options & process_options::grab_stdout) && pipe (reinterpret_cast <int *>(stdout_fd)))
805- throw std::runtime_error{" Can not create stdout pipe. " + std::string{strerror (errno)}};
805+ throw std::runtime_error{" Failed to create stdout pipe. " + std::string{strerror (errno)}};
806806
807807 if (static_cast <bool >(options & process_options::grab_stderr) && pipe (reinterpret_cast <int *>(stderr_fd)))
808- throw std::runtime_error{" Can not create stderr pipe. " + std::string{strerror (errno)}};
808+ throw std::runtime_error{" Failed to create stderr pipe. " + std::string{strerror (errno)}};
809809
810810 const bool standard_streams{static_cast <bool >(options & process_options::grab_stdin) || static_cast <bool >(options & process_options::grab_stdout) || static_cast <bool >(options & process_options::grab_stderr)};
811811 #else
@@ -819,7 +819,7 @@ class process
819819
820820 if (id < 0 )
821821 {
822- throw std::runtime_error{" Can not create process. " + std::string{strerror (errno)}};
822+ throw std::runtime_error{" Failed to create process. " + std::string{strerror (errno)}};
823823 }
824824 else if (id == 0 )
825825 {
@@ -833,7 +833,7 @@ class process
833833
834834 if (id < 0 )
835835 {
836- throw std::runtime_error{" Can not create process. " + std::string{strerror (errno)}};
836+ throw std::runtime_error{" Failed to create process. " + std::string{strerror (errno)}};
837837 }
838838 else if (id == 0 )
839839 {
@@ -920,7 +920,7 @@ class process
920920
921921 int return_code{};
922922 if (waitpid (m_id, &return_code, 0 ) == -1 )
923- throw std::runtime_error{" Can not join the process. " + std::string{strerror (errno)}};
923+ throw std::runtime_error{" Failed to join the process. " + std::string{strerror (errno)}};
924924
925925 m_id = -1 ;
926926 m_return_code = WEXITSTATUS (return_code);
@@ -1016,7 +1016,7 @@ inline std::string working_directory()
10161016 if (errno == ERANGE)
10171017 path.resize (std::size (path) * 2 );
10181018 else
1019- throw std::runtime_error{" Can not get the current working directory. " + std::string{strerror (errno)}};
1019+ throw std::runtime_error{" Failed to get the current working directory. " + std::string{strerror (errno)}};
10201020 }
10211021
10221022 path.resize (path.find_first_of (' \0 ' ));
0 commit comments