From 7e85d8fc8d98cd9ca0e409332d0d10304384e940 Mon Sep 17 00:00:00 2001 From: Olivier FAURAX Date: Fri, 22 Sep 2023 10:08:54 +0200 Subject: [PATCH] Better test for 404 error --- providers/redfish/tasks.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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