~xenrox/10man-api

11505ba3a167d3d3d2bffe7f2b3e92ff92530f6c — Thorben Günther 10 months ago cd9b778
mutation: Improve error handling
1 files changed, 2 insertions(+), 4 deletions(-)

M graph/schema.resolvers.go
M graph/schema.resolvers.go => graph/schema.resolvers.go +2 -4
@@ 192,10 192,8 @@ func (r *mutationResolver) StartQueue(ctx context.Context, teamspeakID string) (
			FROM "User"
			WHERE teamspeak_id = $1`
		err = database.DB.QueryRow(query, teamspeakID).Scan(&queueing)
		if errors.Is(err, sql.ErrNoRows) {
			return players, errors.New("id does not exist")
		} else if err != nil {
			return players, err
		if err != nil {
			return players, database.CheckErrorCode(err)
		}

		if queueing {