Files
openfsd/pkg/fsdclient/errors.go
Reese Norris 0518ad6099 feat(pkg/fsdclient): protocol-faithful FSD client
Dial, login (password/JWT), positions, recorder/WaitFor; imports protocol only.
2026-07-16 12:35:40 -04:00

23 lines
716 B
Go

package fsdclient
import (
"errors"
"fmt"
)
// Common sentinel errors.
var (
// ErrClosed is returned when operating on a closed client.
ErrClosed = errors.New("fsdclient: client closed")
// ErrNotDialed is returned when methods are used before Dial.
ErrNotDialed = errors.New("fsdclient: not dialed")
// ErrBadServerIdent is returned when the first server packet is not a valid $DI.
ErrBadServerIdent = errors.New("fsdclient: expected $DISERVER:CLIENT server identification")
// ErrAlreadyLoggedIn is returned when LoginPilot/LoginATC is called twice.
ErrAlreadyLoggedIn = errors.New("fsdclient: already logged in")
)
func errf(format string, args ...any) error {
return fmt.Errorf(format, args...)
}