glide setup and dependencies addition
This commit is contained in:
35
vendor/gopkg.in/routeros.v2/error.go
generated
vendored
Normal file
35
vendor/gopkg.in/routeros.v2/error.go
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
package routeros
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"gopkg.in/routeros.v2/proto"
|
||||
)
|
||||
|
||||
var (
|
||||
errAlreadyAsync = errors.New("Async() has already been called")
|
||||
errAsyncLoopEnded = errors.New("Async() loop has ended - probably read error")
|
||||
)
|
||||
|
||||
// UnknownReplyError records the sentence whose Word is unknown.
|
||||
type UnknownReplyError struct {
|
||||
Sentence *proto.Sentence
|
||||
}
|
||||
|
||||
func (err *UnknownReplyError) Error() string {
|
||||
return "unknown RouterOS reply word: " + err.Sentence.Word
|
||||
}
|
||||
|
||||
// DeviceError records the sentence containing the error received from the device.
|
||||
// The sentence may have Word !trap or !fatal.
|
||||
type DeviceError struct {
|
||||
Sentence *proto.Sentence
|
||||
}
|
||||
|
||||
func (err *DeviceError) Error() string {
|
||||
m := err.Sentence.Map["message"]
|
||||
if m == "" {
|
||||
m = "unknown error: " + err.Sentence.String()
|
||||
}
|
||||
return "from RouterOS device: " + m
|
||||
}
|
||||
Reference in New Issue
Block a user