As a part of my CI pipelinescript, I want to publish package to nuget feed:
dotnet nuget push package.1.2.3.nupkg --source "mysource" --api-key "mykey"
The command may print error: 409 already contains version 1.2.3 and exit with code 1. This is perfectly fine in my context of CI, but it makes the pipelinewhole script fail. I want to wrap this scriptcommand with something, that will swallow non-zero exit code if specific error appears in stdout, but to bubble up non-zero exit code if it does not appear. What can I use for my task?