GoToolSharing / htb-cli

Interact with Hackthebox using your terminal - Be faster and more competitive !
https://github.com/GoToolSharing/htb-cli
GNU General Public License v3.0
87 stars 6 forks source link

[BUG] Error if challenge / machines is not found #97

Closed QU35T-code closed 10 months ago

QU35T-code commented 10 months ago

To Reproduce Steps to reproduce the behavior:

> go run . submit -c d -d 3 --no-check
No challenge found
Flag :
> go run . submit -m d -d 3 --no-check
2024-01-11T08:24:44.978+0100    ERROR   cmd/submit.go:58        {"error": "no machine was found"}
github.com/GoToolSharing/htb-cli/cmd.glob..func12
    /home/qu35t/Documents/htb-cli/cmd/submit.go:58
github.com/spf13/cobra.(*Command).execute
    /home/qu35t/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:876
github.com/spf13/cobra.(*Command).ExecuteC
    /home/qu35t/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:990
github.com/spf13/cobra.(*Command).Execute
    /home/qu35t/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:918
github.com/GoToolSharing/htb-cli/cmd.Execute
    /home/qu35t/Documents/htb-cli/cmd/root.go:46
main.main
    /home/qu35t/Documents/htb-cli/main.go:8
runtime.main
    /home/qu35t/.local/share/rtx/installs/go/1.21.3/go/src/runtime/proc.go:267
exit status 1
QU35T-code commented 10 months ago
> go run . submit -m sddsdsd -d 1
No machine was found

> go run . submit -c sddsdsd -d 1
No challenge was found