Skip to content

Commit e8b47f4

Browse files
fwieselmumoshu
authored andcommitted
Handle error by outputting it as content
1 parent 05ebff6 commit e8b47f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

diff/diff.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,15 @@ func redactSecrets(old, new *manifest.MappingResult) {
117117
if old != nil {
118118
oldSecret.Data = nil
119119
if err := serializer.Encode(&oldSecret, &buf); err != nil {
120-
120+
new.Content = fmt.Sprintf("Error encoding new secret: %s", err)
121121
}
122122
old.Content = getComment(old.Content) + strings.Replace(strings.Replace(buf.String(), "stringData", "data", 1), " creationTimestamp: null\n", "", 1)
123123
buf.Reset() //reuse buffer for new secret
124124
}
125125
if new != nil {
126126
newSecret.Data = nil
127127
if err := serializer.Encode(&newSecret, &buf); err != nil {
128-
128+
new.Content = fmt.Sprintf("Error encoding new secret: %s", err)
129129
}
130130
new.Content = getComment(new.Content) + strings.Replace(strings.Replace(buf.String(), "stringData", "data", 1), " creationTimestamp: null\n", "", 1)
131131
}

0 commit comments

Comments
 (0)