if error is nil, do not strip extra info
This commit is contained in:
@@ -13,6 +13,9 @@ import (
|
|||||||
// from a Docker error. Specifically, on Windows, this can expose
|
// from a Docker error. Specifically, on Windows, this can expose
|
||||||
// environment variables and other sensitive data.
|
// environment variables and other sensitive data.
|
||||||
func TrimExtraInfo(err error) error {
|
func TrimExtraInfo(err error) error {
|
||||||
|
if err == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
s := err.Error()
|
s := err.Error()
|
||||||
i := strings.Index(s, "extra info:")
|
i := strings.Index(s, "extra info:")
|
||||||
if i > 0 {
|
if i > 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user