Skip to content

Commit

Permalink
(chocolatey#2854) Do Write-Error instead of Write-Warning
Browse files Browse the repository at this point in the history
The catch of Get-ChocolateyConfigValue should reasonably be an error and
not a warning. Changing this to send an error so the package can handle
it if desired.
  • Loading branch information
corbob committed Jun 20, 2023
1 parent 2021987 commit de30163
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright © 2022 Chocolatey Software, Inc.
# Copyright © 2022 Chocolatey Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -58,7 +58,6 @@ $value = Get-ChocolateyConfigValue -configKey 'cacheLocation'
Select-Object -ExpandProperty value
}
catch {
Write-Warning "Unable to read config value '$configKey' with error"
Write-Warning $_
Write-Error "Unable to read config value '$configKey' with error" -Exception $_
}
}

0 comments on commit de30163

Please sign in to comment.