Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
5d1e9168
Commit
5d1e9168
authored
Apr 19, 2023
by
Levin Zimmermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
neonet += ErrUnexpectedMsg to propagate msg type
parent
cc96af58
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
go/neo/neonet/connection.go
go/neo/neonet/connection.go
+10
-1
No files found.
go/neo/neonet/connection.go
View file @
5d1e9168
...
...
@@ -231,6 +231,15 @@ var ErrLinkNoListen = errors.New("node link is not listening for incoming connec
var
ErrLinkManyConn
=
errors
.
New
(
"too many opened connections"
)
var
ErrClosedConn
=
errors
.
New
(
"connection is closed"
)
type
ErrUnexpectedMsg
struct
{
Msg
string
MsgType
reflect
.
Type
}
func
(
e
*
ErrUnexpectedMsg
)
Error
()
string
{
return
fmt
.
Sprintf
(
"%s %v"
,
e
.
Msg
,
e
.
MsgType
)
}
// LinkError is returned by NodeLink operations.
type
LinkError
struct
{
Link
*
NodeLink
...
...
@@ -1600,7 +1609,7 @@ func (c *Conn) Expect(msgv ...proto.Msg) (which int, err error) {
}
// XXX also add which messages were expected ?
return
-
1
,
c
.
err
(
"recv"
,
fmt
.
Errorf
(
"unexpected message: %v"
,
msgType
)
)
return
-
1
,
c
.
err
(
"recv"
,
&
ErrUnexpectedMsg
{
"unexpected message"
,
msgType
}
)
}
// Ask sends request and receives a response.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment