Skip to content

Commit

Permalink
Better test for 404 error
Browse files Browse the repository at this point in the history
  • Loading branch information
ofaurax committed Sep 22, 2023
1 parent 2e453c6 commit 7e85d8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion providers/redfish/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7e85d8f

Please sign in to comment.