Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mybee
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
mybee
Commits
7eb14f1e
Commit
7eb14f1e
authored
Jan 28, 2020
by
Janos Guljas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
format comments in libp2p error.go file
parent
be5f523c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
error.go
pkg/p2p/libp2p/error.go
+7
-6
No files found.
pkg/p2p/libp2p/error.go
View file @
7eb14f1e
// Copyright 2020 The Swarm Authors. All rights reserved.
// Copyright 2020 The Swarm Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// license that can be found in the LICENSE file.
package
libp2p
package
libp2p
// This error is handled specially by libp2p
// This error is handled specially by libp2p
. If returned by specific protocol
//
If returned by specific protocol handler it causes peer disconnect
//
handler it causes peer disconnect.
type
disconnectError
struct
{
type
disconnectError
struct
{
err
error
err
error
}
}
// Disconnect wraps error and creates a special error that is treated specially
by libp2p
// Disconnect wraps error and creates a special error that is treated specially
//
It causes peer disconnect
//
by libp2p. It causes peer to disconnect.
func
Disconnect
(
err
error
)
error
{
func
Disconnect
(
err
error
)
error
{
return
&
disconnectError
{
return
&
disconnectError
{
err
:
err
,
err
:
err
,
}
}
}
}
// Unwrap returns an underlying error
// Unwrap returns an underlying error
.
func
(
e
*
disconnectError
)
Unwrap
()
error
{
return
e
.
err
}
func
(
e
*
disconnectError
)
Unwrap
()
error
{
return
e
.
err
}
// Error implements function of the standard go error interface
// Error implements function of the standard go error interface
.
func
(
e
*
disconnectError
)
Error
()
string
{
func
(
e
*
disconnectError
)
Error
()
string
{
return
e
.
err
.
Error
()
return
e
.
err
.
Error
()
}
}
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