dlugolecki.net.pl
Dziennik
Polecane
Software
projects
/
command.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleanup exceptions.
[command.git]
/
include
/
command.h
diff --git
a/include/command.h
b/include/command.h
index 98db4296656221361f8579f028a410417b560ac8..0cbb3d6eba84d4a02c1391f316f710de189c1514 100644
(file)
--- a/
include/command.h
+++ b/
include/command.h
@@
-6,6
+6,7
@@
#include <typeinfo>
#include "parameter.h"
#include <typeinfo>
#include "parameter.h"
+#include "exception/missingRequiredParameter.h"
namespace command {
/**
namespace command {
/**
@@
-29,11
+30,11
@@
namespace command {
try {
matchArguments(argc, argv);
}
try {
matchArguments(argc, argv);
}
- catch(
std::invalid_argument
exception) {
+ catch(
const std::invalid_argument &
exception) {
releaseMemory();
throw;
}
releaseMemory();
throw;
}
- catch(
std::logic_error
exception) {
+ catch(
const std::logic_error &
exception) {
releaseMemory();
throw;
}
releaseMemory();
throw;
}
@@
-60,7
+61,7
@@
namespace command {
}
for(Parameter *param : parameters) {
if (param->isRequired() && !param->isUsed()) {
}
for(Parameter *param : parameters) {
if (param->isRequired() && !param->isUsed()) {
- throw
std::logic_erro
r(param->describe() + " is required but it was not passed");
+ throw
MissingRequiredParamete
r(param->describe() + " is required but it was not passed");
}
}
}
}
}
}