Skip to content

Commit 8eee90d

Browse files
committed
fixed errors on bad account name
1 parent 190c3ac commit 8eee90d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cmd/discord/commands/public/career.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package public
33
import (
44
"bytes"
55
"context"
6+
"errors"
67
"fmt"
78

89
"github.com/cufee/aftermath/cmd/discord/commands"
@@ -16,6 +17,7 @@ import (
1617
"github.com/cufee/aftermath/internal/logic"
1718
"github.com/cufee/aftermath/internal/permissions"
1819
stats "github.com/cufee/aftermath/internal/stats/client/common"
20+
"github.com/cufee/aftermath/internal/stats/fetch/v1"
1921
"github.com/cufee/aftermath/internal/utils"
2022
)
2123

@@ -72,7 +74,7 @@ func careerCommandHandler(ctx common.Context) error {
7274
case options.NicknameSearch != "" && options.AccountID == "":
7375
// nickname provided, but user did not select an option from autocomplete
7476
accounts, err := accountsFromBadInput(ctx.Ctx(), ctx.Core().Fetch(), options.NicknameSearch)
75-
if err != nil {
77+
if err != nil && !errors.Is(err, fetch.ErrAccountNotFound) {
7678
return ctx.Err(err, common.ApplicationError)
7779
}
7880
if len(accounts) == 0 {

cmd/discord/commands/public/session.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func init() {
7474
case options.NicknameSearch != "" && options.AccountID == "":
7575
// nickname provided, but user did not select an option from autocomplete
7676
accounts, err := accountsFromBadInput(ctx.Ctx(), ctx.Core().Fetch(), options.NicknameSearch)
77-
if err != nil {
77+
if err != nil && !errors.Is(err, fetch.ErrAccountNotFound) {
7878
return ctx.Err(err, common.ApplicationError)
7979
}
8080
if len(accounts) == 0 {

0 commit comments

Comments
 (0)