Let configuration has it's own Err type

This commit is contained in:
Tnze
2023-11-19 02:34:30 +08:00
parent 006f958f43
commit 2c2f1547be
3 changed files with 40 additions and 19 deletions

View File

@ -24,6 +24,19 @@ import (
pk "github.com/Tnze/go-mc/net/packet"
)
type LoginErr struct {
Stage string
Err error
}
func (l LoginErr) Error() string {
return "bot: login error: [" + l.Stage + "] " + l.Err.Error()
}
func (l LoginErr) Unwrap() error {
return l.Err
}
func (c *Client) joinLogin(conn *net.Conn) error {
var err error
if c.Auth.UUID != "" {