Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
dcdb
dcdb
Commits
ce588cb9
Commit
ce588cb9
authored
Jul 23, 2013
by
Axel Auweter
Browse files
Fixed exception handling. Time to learn C++...
parent
1c44d4d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
CollectAgent/collectagent.cpp
View file @
ce588cb9
...
...
@@ -191,14 +191,14 @@ void mqttCallback(SimpleMQTTMessage *msg)
#endif
}
}
catch
(
TTransportException
*
te
){
cout
<<
"TP Exception: "
<<
te
->
what
()
<<
"["
<<
te
->
getType
()
<<
"]
\n
"
;
catch
(
const
TTransportException
&
te
){
cout
<<
"TP Exception: "
<<
te
.
what
()
<<
"["
<<
te
.
getType
()
<<
"]
\n
"
;
}
catch
(
InvalidRequestException
*
ire
){
cout
<<
"IRE Exception: "
<<
ire
->
what
()
<<
"["
<<
ire
->
why
<<
"]
\n
"
;
catch
(
const
InvalidRequestException
&
ire
){
cout
<<
"IRE Exception: "
<<
ire
.
what
()
<<
"["
<<
ire
.
why
<<
"]
\n
"
;
}
catch
(
NotFoundException
*
nfe
){
cout
<<
"NF Exception: "
<<
nfe
->
what
()
<<
"
\n
"
;
catch
(
const
NotFoundException
&
nfe
){
cout
<<
"NF Exception: "
<<
nfe
.
what
()
<<
"
\n
"
;
}
delete
msg
;
...
...
@@ -282,14 +282,17 @@ int main(void) {
cout
<<
"Using existing sensordata column familiy.
\n
"
;
}
}
catch
(
TTransportException
*
te
){
cout
<<
"TP Exception: "
<<
te
->
what
()
<<
"["
<<
te
->
getType
()
<<
"]
\n
"
;
catch
(
const
TTransportException
&
te
){
cout
<<
"TP Exception: "
<<
te
.
what
()
<<
"["
<<
te
.
getType
()
<<
"]
\n
"
;
exit
(
EXIT_FAILURE
);
}
catch
(
InvalidRequestException
*
ire
){
cout
<<
"IRE Exception: "
<<
ire
->
what
()
<<
"["
<<
ire
->
why
<<
"]
\n
"
;
catch
(
const
InvalidRequestException
&
ire
){
cout
<<
"IRE Exception: "
<<
ire
.
what
()
<<
"["
<<
ire
.
why
<<
"]
\n
"
;
exit
(
EXIT_FAILURE
);
}
catch
(
NotFoundException
*
nfe
){
cout
<<
"NF Exception: "
<<
nfe
->
what
()
<<
"
\n
"
;
catch
(
const
NotFoundException
&
nfe
){
cout
<<
"NF Exception: "
<<
nfe
.
what
()
<<
"
\n
"
;
exit
(
EXIT_FAILURE
);
}
/* Catch SIGINT signals */
...
...
@@ -324,8 +327,8 @@ int main(void) {
ms
.
stop
();
}
catch
(
exception
*
e
)
{
cout
<<
"Exception: "
<<
e
->
what
()
<<
"
\n
"
;
catch
(
const
exception
&
e
)
{
cout
<<
"Exception: "
<<
e
.
what
()
<<
"
\n
"
;
}
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment