ax(mining): replace banned errors.New with ErrUnsupportedMiner in ttminer

Remove the banned `errors` import from ttminer.go. The single call
to errors.New is replaced with the existing ErrUnsupportedMiner
constructor from errors.go, which carries the OS name, HTTP status,
and a details note about CUDA requirements.

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 16:11:30 +01:00
parent b6a2fb626e
commit dfe3255abb
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -2,7 +2,6 @@ package mining
import (
"bytes"
"errors"
"fmt"
"os"
"os/exec"
@ -109,7 +108,7 @@ func (m *TTMiner) Install() error {
// Linux version - uses .tar.gz
url = fmt.Sprintf("https://github.com/TrailingStop/TT-Miner-release/releases/download/%s/TT-Miner-%s.tar.gz", version, version)
default:
return errors.New("TT-Miner is only available for Windows and Linux (requires CUDA)")
return ErrUnsupportedMiner(runtime.GOOS).WithDetails("TT-Miner requires CUDA; only Windows and Linux are supported")
}
if err := m.InstallFromURL(url); err != nil {