Commit 7eb14f1e authored by Janos Guljas's avatar Janos Guljas

format comments in libp2p error.go file

parent be5f523c
// Copyright 2020 The Swarm Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package libp2p
// This error is handled specially by libp2p
// If returned by specific protocol handler it causes peer disconnect
// This error is handled specially by libp2p. If returned by specific protocol
// handler it causes peer disconnect.
type disconnectError struct {
err error
}
// Disconnect wraps error and creates a special error that is treated specially by libp2p
// It causes peer disconnect
// Disconnect wraps error and creates a special error that is treated specially
// by libp2p. It causes peer to disconnect.
func Disconnect(err error) error {
return &disconnectError{
err: err,
}
}
// Unwrap returns an underlying error
// Unwrap returns an underlying error.
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 {
return e.err.Error()
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment