Skip to main content
edited tags
Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 263
deleted 3 characters in body
Source Link

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?

As a part of my CI pipeline, 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 context of CI, but it makes the pipeline fail. I want to wrap this script 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?

As a part of my script, 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, but it makes the whole script fail. I want to wrap this command 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?

Source Link

Handle specific error in bash

As a part of my CI pipeline, 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 context of CI, but it makes the pipeline fail. I want to wrap this script 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?