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
995a128c
Commit
995a128c
authored
Apr 26, 2023
by
Levin Zimmermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! neonet += ErrUnexpectedMsg to propagate msg type
parent
5d1e9168
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
go/neo/neonet/connection.go
go/neo/neonet/connection.go
+5
-4
No files found.
go/neo/neonet/connection.go
View file @
995a128c
...
...
@@ -232,12 +232,13 @@ var ErrLinkManyConn = errors.New("too many opened connections")
var
ErrClosedConn
=
errors
.
New
(
"connection is closed"
)
type
ErrUnexpectedMsg
struct
{
Msg
string
MsgType
reflect
.
Type
ErrorMsg
string
MsgCode
uint16
Msg
proto
.
Msg
}
func
(
e
*
ErrUnexpectedMsg
)
Error
()
string
{
return
fmt
.
Sprintf
(
"%s %v"
,
e
.
Msg
,
e
.
MsgType
)
return
fmt
.
Sprintf
(
"%s %v"
,
e
.
ErrorMsg
,
proto
.
MsgType
(
e
.
MsgCode
)
)
}
// LinkError is returned by NodeLink operations.
...
...
@@ -1609,7 +1610,7 @@ func (c *Conn) Expect(msgv ...proto.Msg) (which int, err error) {
}
// XXX also add which messages were expected ?
return
-
1
,
c
.
err
(
"recv"
,
&
ErrUnexpectedMsg
{
"unexpected message"
,
msg
Type
})
return
-
1
,
c
.
err
(
"recv"
,
&
ErrUnexpectedMsg
{
"unexpected message"
,
msg
Code
,
msgv
[
0
]
})
}
// 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