Skip to content

Commit d23d377

Browse files
committed
Fix to use system_exceptiont
Replace std::* exceptions in Windows code with system_exceptiont
1 parent 135af05 commit d23d377

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/util/piped_process.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ piped_processt::piped_processt(const std::vector<std::string> commandvec)
132132
&sec_attr); // For inheritance by child
133133
if(child_std_IN_Rd == INVALID_HANDLE_VALUE)
134134
{
135-
throw std::runtime_error("Input pipe creation failed for child_std_IN_Rd");
135+
throw system_exceptiont("Input pipe creation failed for child_std_IN_Rd");
136136
}
137137
// Connect to the other side of the pipe
138138
child_std_IN_Wr = CreateFileA(
@@ -145,11 +145,11 @@ piped_processt::piped_processt(const std::vector<std::string> commandvec)
145145
NULL);
146146
if(child_std_IN_Wr == INVALID_HANDLE_VALUE)
147147
{
148-
throw std::runtime_error("Input pipe creation failed for child_std_IN_Wr");
148+
throw system_exceptiont("Input pipe creation failed for child_std_IN_Wr");
149149
}
150150
if(!SetHandleInformation(child_std_IN_Rd, HANDLE_FLAG_INHERIT, 0))
151151
{
152-
throw std::runtime_error(
152+
throw system_exceptiont(
153153
"Input pipe creation failed on SetHandleInformation");
154154
}
155155
const std::string out_name = base_name + "\\OUT";
@@ -164,8 +164,7 @@ piped_processt::piped_processt(const std::vector<std::string> commandvec)
164164
&sec_attr); // For inheritance by child
165165
if(child_std_OUT_Rd == INVALID_HANDLE_VALUE)
166166
{
167-
throw std::runtime_error(
168-
"Output pipe creation failed for child_std_OUT_Rd");
167+
throw system_exceptiont("Output pipe creation failed for child_std_OUT_Rd");
169168
}
170169
child_std_OUT_Wr = CreateFileA(
171170
out_name.c_str(),
@@ -177,12 +176,11 @@ piped_processt::piped_processt(const std::vector<std::string> commandvec)
177176
NULL);
178177
if(child_std_OUT_Wr == INVALID_HANDLE_VALUE)
179178
{
180-
throw std::runtime_error(
181-
"Output pipe creation failed for child_std_OUT_Wr");
179+
throw system_exceptiont("Output pipe creation failed for child_std_OUT_Wr");
182180
}
183181
if(!SetHandleInformation(child_std_OUT_Rd, HANDLE_FLAG_INHERIT, 0))
184182
{
185-
throw std::runtime_error(
183+
throw system_exceptiont(
186184
"Output pipe creation failed on SetHandleInformation");
187185
}
188186
// Create the child process

0 commit comments

Comments
 (0)