You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
416 B
Go
22 lines
416 B
Go
9 years ago
|
package steam
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
)
|
||
|
|
||
|
type ClientError struct {
|
||
|
msg string
|
||
|
parent error
|
||
|
}
|
||
|
|
||
|
func (c ClientError) Error() string {
|
||
|
if c.parent == nil {
|
||
|
return fmt.Sprintf("steam client error: %s", c.msg)
|
||
|
}
|
||
|
return fmt.Sprintf("steam client error: %s: %v", c.msg, c.parent)
|
||
|
}
|
||
|
|
||
|
func errorf(parent error, msg string, args ...interface{}) error {
|
||
|
return ClientError{msg: fmt.Sprintf(msg, args...), parent: parent}
|
||
|
}
|