diff --git a/providers/redfish/tasks.go b/providers/redfish/tasks.go index b5af7e2e..49813f49 100644 --- a/providers/redfish/tasks.go +++ b/providers/redfish/tasks.go @@ -124,7 +124,7 @@ func (c *Conn) purgeQueuedFirmwareInstallTask(ctx context.Context, component str func (c *Conn) GetTask(taskID string) (task *gofishrf.Task, err error) { resp, err := c.redfishwrapper.Get("/redfish/v1/TaskService/Tasks/" + taskID) if err != nil { - if err.Error()[0:3] == "404" { + if strings.HasPrefix(err.Error(), "404") { return nil, errors.Wrap(bmclibErrs.ErrTaskNotFound, "task with ID not found: "+taskID) } return nil, err