Skip to content

Commit 2026f6f

Browse files
authored
Merge pull request #3226 from owen-jones-diffblue/cleanup/throw-exception-instead-of-string
Don't throw bare string "Failed to find state"
2 parents d21b20b + 5677f0e commit 2026f6f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/analyses/ai.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ class ait:public ai_baset
305305
{
306306
typename state_mapt::iterator it=state_map.find(l);
307307
if(it==state_map.end())
308-
throw "failed to find state";
308+
throw std::out_of_range("failed to find state");
309309

310310
return it->second;
311311
}
@@ -314,7 +314,7 @@ class ait:public ai_baset
314314
{
315315
typename state_mapt::const_iterator it=state_map.find(l);
316316
if(it==state_map.end())
317-
throw "failed to find state";
317+
throw std::out_of_range("failed to find state");
318318

319319
return it->second;
320320
}
@@ -355,7 +355,7 @@ class ait:public ai_baset
355355
{
356356
typename state_mapt::const_iterator it=state_map.find(l);
357357
if(it==state_map.end())
358-
throw "failed to find state";
358+
throw std::out_of_range("failed to find state");
359359

360360
return it->second;
361361
}

src/analyses/static_analysis.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ class static_analysist:public static_analysis_baset
291291
{
292292
typename state_mapt::iterator it=state_map.find(l);
293293
if(it==state_map.end())
294-
throw "failed to find state";
294+
throw std::out_of_range("failed to find state");
295295

296296
return it->second;
297297
}
@@ -300,7 +300,7 @@ class static_analysist:public static_analysis_baset
300300
{
301301
typename state_mapt::const_iterator it=state_map.find(l);
302302
if(it==state_map.end())
303-
throw "failed to find state";
303+
throw std::out_of_range("failed to find state");
304304

305305
return it->second;
306306
}
@@ -324,7 +324,7 @@ class static_analysist:public static_analysis_baset
324324
{
325325
typename state_mapt::iterator it=state_map.find(l);
326326
if(it==state_map.end())
327-
throw "failed to find state";
327+
throw std::out_of_range("failed to find state");
328328

329329
return it->second;
330330
}
@@ -333,7 +333,7 @@ class static_analysist:public static_analysis_baset
333333
{
334334
typename state_mapt::const_iterator it=state_map.find(l);
335335
if(it==state_map.end())
336-
throw "failed to find state";
336+
throw std::out_of_range("failed to find state");
337337

338338
return it->second;
339339
}

0 commit comments

Comments
 (0)