Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dhtnet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
dhtnet
Commits
084d8a3a
Commit
084d8a3a
authored
8 months ago
by
Amna Snene
Browse files
Options
Downloads
Patches
Plain Diff
tools: dhtnetmgr handle errors when saving identity
Change-Id: Iac3504f46050c2d533fa2837240f53b8c03068e8
parent
c5ce2695
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/dhtnet_crtmgr/dhtnet_crtmgr.cpp
+7
-1
7 additions, 1 deletion
tools/dhtnet_crtmgr/dhtnet_crtmgr.cpp
with
7 additions
and
1 deletion
tools/dhtnet_crtmgr/dhtnet_crtmgr.cpp
+
7
−
1
View file @
084d8a3a
...
...
@@ -49,7 +49,13 @@ dht::crypto::Identity generateIdentity(const std::filesystem::path& path_id, con
fmt
::
print
(
stderr
,
"Error: failed to create directory {}
\n
"
,
path_id
.
string
());
return
{};
}
dht
::
crypto
::
saveIdentity
(
identity
,
path_id
/
name
);
// catch error
try
{
dht
::
crypto
::
saveIdentity
(
identity
,
path_id
/
name
);
}
catch
(
const
std
::
exception
&
e
)
{
fmt
::
print
(
stderr
,
"Error: failed to save identity: {}
\n
"
,
e
.
what
());
return
{};
}
return
identity
;
}
}
// namespace dhtnet
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