Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
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
Package registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
5caa7a35
Commit
5caa7a35
authored
7 years ago
by
Michael Davis
Browse files
Options
Downloads
Patches
Plain Diff
[cta-frontend] Adds logging of all errors processing Requests
parent
e929bf76
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xroot_plugins/XrdSsiCtaRequestProc.cpp
+21
-7
21 additions, 7 deletions
xroot_plugins/XrdSsiCtaRequestProc.cpp
with
21 additions
and
7 deletions
xroot_plugins/XrdSsiCtaRequestProc.cpp
+
21
−
7
View file @
5caa7a35
...
...
@@ -38,6 +38,9 @@ void ExceptionHandler<cta::xrd::Response, PbException>::operator()(cta::xrd::Res
{
response
.
set_type
(
cta
::
xrd
::
Response
::
RSP_ERR_PROTOBUF
);
response
.
set_message_txt
(
ex
.
what
());
// Log the error in the CTA log
//m_lc.log(cta::log::ERROR, "In ExceptionHandler(): RSP_ERR_PROTOBUF: " + ex.what());
}
...
...
@@ -48,26 +51,37 @@ void ExceptionHandler<cta::xrd::Response, PbException>::operator()(cta::xrd::Res
template
<
>
void
RequestProc
<
cta
::
xrd
::
Request
,
cta
::
xrd
::
Response
,
cta
::
xrd
::
Alert
>::
ExecuteAction
()
{
try
{
// Perform a capability query on the XrdSsiProviderServer object: it must be a XrdSsiCtaServiceProvider
XrdSsiCtaServiceProvider
*
cta_service_ptr
;
const
std
::
string
ErrorFunction
(
"In RequestProc::ExecuteAction(): "
);
XrdSsiCtaServiceProvider
*
cta_service_ptr
;
try
{
// Perform a capability query (sanity check):
// the object pointed to by XrdSsiProviderServer must be a XrdSsiCtaServiceProvider
if
(
!
(
cta_service_ptr
=
dynamic_cast
<
XrdSsiCtaServiceProvider
*>
(
XrdSsiProviderServer
)))
{
throw
cta
::
exception
::
Exception
(
"XRootD Service is not a CTA Service"
);
// If not, this is fatal unrecoverable error
throw
std
::
logic_error
(
"XRootD Service is not a CTA Service"
);
}
// Process the message
cta
::
xrd
::
RequestMessage
request_msg
(
*
(
m_resource
.
client
),
cta_service_ptr
);
request_msg
.
process
(
m_request
,
m_metadata
,
m_response_stream_ptr
);
}
catch
(
PbException
&
ex
)
{
m_metadata
.
set_type
(
cta
::
xrd
::
Response
::
RSP_ERR_PROTOBUF
);
m_metadata
.
set_message_txt
(
ex
.
what
());
cta_service_ptr
->
getLogContext
().
log
(
cta
::
log
::
ERR
,
ErrorFunction
+
"RSP_ERR_PROTOBUF: "
+
ex
.
what
());
}
catch
(
cta
::
exception
::
UserError
&
ex
)
{
m_metadata
.
set_type
(
cta
::
xrd
::
Response
::
RSP_ERR_USER
);
m_metadata
.
set_message_txt
(
ex
.
getMessageValue
());
}
catch
(
PbException
&
ex
)
{
m_metadata
.
set_type
(
cta
::
xrd
::
Response
::
RSP_ERR_PROTOBUF
);
cta_service_ptr
->
getLogContext
().
log
(
cta
::
log
::
ERR
,
ErrorFunction
+
"RSP_ERR_USER: "
+
ex
.
getMessageValue
());
}
catch
(
cta
::
exception
::
Exception
&
ex
)
{
m_metadata
.
set_type
(
cta
::
xrd
::
Response
::
RSP_ERR_CTA
);
m_metadata
.
set_message_txt
(
ex
.
what
());
}
catch
(
std
::
exception
&
ex
)
{
cta_service_ptr
->
getLogContext
().
log
(
cta
::
log
::
ERR
,
ErrorFunction
+
"RSP_ERR_CTA: "
+
ex
.
what
());
}
catch
(
std
::
runtime_error
&
ex
)
{
m_metadata
.
set_type
(
cta
::
xrd
::
Response
::
RSP_ERR_CTA
);
m_metadata
.
set_message_txt
(
ex
.
what
());
cta_service_ptr
->
getLogContext
().
log
(
cta
::
log
::
ERR
,
ErrorFunction
+
"RSP_ERR_CTA: "
+
ex
.
what
());
}
}
...
...
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