In the original code, if the Delete function returns any error, this error is immediately returned, which has caused us problems as it includes the case where the error is a 404 (resource not found). This is the expected scenario when the resource is already deleted.
The change updates error handling to specifically check if the error is not a 404. If the error is anything other than a 404, it's returned. Should also allow adding additional error-handling cases in the future.
In the original code, if the Delete function returns any error, this error is immediately returned, which has caused us problems as it includes the case where the error is a 404 (resource not found). This is the expected scenario when the resource is already deleted.
The change updates error handling to specifically check if the error is not a 404. If the error is anything other than a 404, it's returned. Should also allow adding additional error-handling cases in the future.