Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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
elixxir
client
Commits
9f505dc5
Commit
9f505dc5
authored
4 years ago
by
Richard T. Carback III
Browse files
Options
Downloads
Patches
Plain Diff
Fix error handling on auth request
parent
e9225a2d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
auth/request.go
+13
-9
13 additions, 9 deletions
auth/request.go
with
13 additions
and
9 deletions
auth/request.go
+
13
−
9
View file @
9f505dc5
...
...
@@ -53,15 +53,19 @@ func RequestAuth(partner, me contact.Contact, message string, rng io.Reader,
//lookup if an ongoing request is occurring
rqType
,
_
,
_
,
err
:=
storage
.
Auth
()
.
GetRequest
(
partner
.
ID
)
if
err
!=
nil
&&
!
strings
.
Contains
(
err
.
Error
(),
auth
.
NoRequest
)
{
return
errors
.
WithMessage
(
err
,
"Error on lookup of potential "
+
"existing request"
)
}
else
if
rqType
==
auth
.
Receive
{
return
errors
.
WithMessage
(
err
,
"Cannot send a request after"
+
"receiving a request"
)
}
else
if
rqType
==
auth
.
Sent
{
return
errors
.
WithMessage
(
err
,
"Cannot send a request after"
+
"already sending one"
)
if
err
!=
nil
&&
strings
.
Contains
(
err
.
Error
(),
auth
.
NoRequest
)
{
err
=
nil
}
if
err
!=
nil
{
if
rqType
==
auth
.
Receive
{
return
errors
.
WithMessage
(
err
,
"Cannot send a request after "
+
"receiving a request"
)
}
else
if
rqType
==
auth
.
Sent
{
return
errors
.
WithMessage
(
err
,
"Cannot send a request after "
+
"already sending one"
)
}
}
grp
:=
storage
.
E2e
()
.
GetGroup
()
...
...
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