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. // 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()
} }
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