Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Project Juggler
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIC
Project Juggler
Commits
01e88698
Commit
01e88698
authored
Sep 29, 2022
by
Sylvester Joosten
Browse files
Options
Downloads
Patches
Plain Diff
Feat: catch exceptions from algorithms in Juggler
parent
6ac83f14
No related branches found
No related tags found
1 merge request
!482
Feat: catch exceptions from algorithms in Juggler
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
JugAlgo/JugAlgo/Algorithm.h
+33
-27
33 additions, 27 deletions
JugAlgo/JugAlgo/Algorithm.h
JugAlgo/src/components/AlgoServiceSvc.cpp
+62
-62
62 additions, 62 deletions
JugAlgo/src/components/AlgoServiceSvc.cpp
with
95 additions
and
89 deletions
JugAlgo/JugAlgo/Algorithm.h
+
33
−
27
View file @
01e88698
...
...
@@ -42,6 +42,8 @@ public:
StatusCode
initialize
()
override
{
debug
()
<<
"Initializing "
<<
name
()
<<
endmsg
;
// Algorithms uses exceptions, Gaudi uses StatusCode --> catch and propagate
try
{
// Grab the AlgoServiceSvc
m_algo_svc
=
service
(
"AlgoServiceSvc"
);
if
(
!
m_algo_svc
)
{
...
...
@@ -71,6 +73,10 @@ public:
// call the internal algorithm init
debug
()
<<
"Initializing underlying algorithm "
<<
m_algo
.
name
()
<<
endmsg
;
m_algo
.
init
();
}
catch
(
const
std
::
exception
&
e
)
{
fatal
()
<<
e
.
what
()
<<
endmsg
;
return
StatusCode
::
FAILURE
;
}
return
StatusCode
::
SUCCESS
;
}
...
...
This diff is collapsed.
Click to expand it.
JugAlgo/src/components/AlgoServiceSvc.cpp
+
62
−
62
View file @
01e88698
...
...
@@ -37,6 +37,7 @@ StatusCode AlgoServiceSvc::initialize() {
return
sc
;
}
try
{
auto
&
serviceSvc
=
algorithms
::
ServiceSvc
::
instance
();
info
()
<<
"ServiceSvc declared "
<<
serviceSvc
.
services
().
size
()
<<
" services"
<<
endmsg
;
// Always initialize the LogSvc first to ensure proper logging for the others
...
...
@@ -44,8 +45,8 @@ StatusCode AlgoServiceSvc::initialize() {
auto
&
logger
=
algorithms
::
LogSvc
::
instance
();
const
algorithms
::
LogLevel
level
{
static_cast
<
algorithms
::
LogLevel
>
(
msgLevel
()
>
0
?
msgLevel
()
-
1
:
0
)};
info
()
<<
"Setting up algorithms::LogSvc with default level "
<<
algorithms
::
logLevelName
(
level
)
<<
endmsg
;
info
()
<<
"Setting up algorithms::LogSvc with default level "
<<
algorithms
::
logLevelName
(
level
)
<<
endmsg
;
logger
.
defaultLevel
(
level
);
logger
.
init
(
[
this
](
const
algorithms
::
LogLevel
l
,
std
::
string_view
caller
,
std
::
string_view
msg
)
{
...
...
@@ -101,9 +102,8 @@ StatusCode AlgoServiceSvc::initialize() {
}
// Validate our service setup
try
{
serviceSvc
.
validate
();
}
catch
(
const
algorithms
::
ServiceError
&
e
)
{
}
catch
(
const
std
::
exception
&
e
)
{
fatal
()
<<
e
.
what
()
<<
endmsg
;
return
StatusCode
::
FAILURE
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment