Skip to content

Commit

Permalink
Fixes error assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
JyotinderSingh committed Nov 17, 2024
1 parent 80e16f6 commit 76b0ea6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions internal/worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,9 @@ func (w *BaseWorker) executeCommand(ctx context.Context, diceDBCmd *cmd.DiceDBCm
if err != nil {
var workerErr error
// Check if it's a CustomError
if customErr, ok := err.(*diceerrors.PreProcessError); ok {
var customErr *diceerrors.PreProcessError
if errors.As(err, &customErr) {
workerErr = w.ioHandler.Write(ctx, customErr.Result)
} else {
workerErr = w.ioHandler.Write(ctx, err)
}
if workerErr != nil {
slog.Debug("Error executing for worker", slog.String("workerID", w.id), slog.Any("error", workerErr))
Expand Down

0 comments on commit 76b0ea6

Please sign in to comment.