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
20f1eb79
Commit
20f1eb79
authored
8 years ago
by
Daniele Kruse
Browse files
Options
Downloads
Patches
Plain Diff
Removed dependency on cta exception from the CLI
parent
ec8a0db3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmdline/CTACmdMain.cpp
+4
-7
4 additions, 7 deletions
cmdline/CTACmdMain.cpp
common/dataStructures/FrontendReturnCode.hpp
+3
-1
3 additions, 1 deletion
common/dataStructures/FrontendReturnCode.hpp
with
7 additions
and
8 deletions
cmdline/CTACmdMain.cpp
+
4
−
7
View file @
20f1eb79
...
...
@@ -17,7 +17,6 @@
*/
#include
"common/Configuration.hpp"
#include
"common/exception/Exception.hpp"
#include
"common/dataStructures/FrontendReturnCode.hpp"
#include
"XrdCl/XrdClCopyProcess.hh"
...
...
@@ -34,6 +33,7 @@
#include
<stdlib.h>
#include
<string.h>
#include
<unistd.h>
#include
<stdexcept>
/**
* Replaces all occurrences in a string "str" of a substring "from" with the string "to"
...
...
@@ -123,20 +123,20 @@ int sendCommand(const int argc, const char **argv) {
XrdCl
::
XRootDStatus
status
=
copyProcess
.
AddJob
(
properties
,
&
results
);
if
(
!
status
.
IsOK
())
{
throw
cta
::
exception
::
Exception
(
status
.
ToStr
());
throw
std
::
runtime_error
(
status
.
ToStr
());
}
status
=
copyProcess
.
Prepare
();
if
(
!
status
.
IsOK
())
{
throw
cta
::
exception
::
Exception
(
status
.
ToStr
());
throw
std
::
runtime_error
(
status
.
ToStr
());
}
XrdCl
::
CopyProgressHandler
copyProgressHandler
;
status
=
copyProcess
.
Run
(
&
copyProgressHandler
);
if
(
!
status
.
IsOK
())
{
throw
cta
::
exception
::
Exception
(
status
.
ToStr
());
throw
std
::
runtime_error
(
status
.
ToStr
());
}
dup2
(
saved_stdout
,
STDOUT_FILENO
);
//re-redirecting std::out to the original (everything we want is in the pipe by now)
...
...
@@ -165,9 +165,6 @@ int sendCommand(const int argc, const char **argv) {
int
main
(
const
int
argc
,
const
char
**
argv
)
{
try
{
return
sendCommand
(
argc
,
argv
);
}
catch
(
cta
::
exception
::
Exception
&
ex
)
{
std
::
cerr
<<
"Failed to execute the command. Reason: "
<<
ex
.
getMessageValue
()
<<
std
::
endl
;
return
cta
::
common
::
dataStructures
::
FrontendReturnCode
::
ctaErrorNoRetry
;
}
catch
(
std
::
exception
&
ex
)
{
std
::
cerr
<<
"Failed to execute the command. Reason: "
<<
ex
.
what
()
<<
std
::
endl
;
return
cta
::
common
::
dataStructures
::
FrontendReturnCode
::
ctaErrorNoRetry
;
...
...
This diff is collapsed.
Click to expand it.
common/dataStructures/FrontendReturnCode.hpp
+
3
−
1
View file @
20f1eb79
...
...
@@ -23,7 +23,9 @@
namespace
cta
{
namespace
common
{
namespace
dataStructures
{
/**
* This is used by both CLI and Frontend so it should work for SLC6 as well
*/
enum
FrontendReturnCode
{
ok
,
userErrorNoRetry
,
...
...
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