Skip to content

Commit 20848b4

Browse files
cuishuangfredbi
authored andcommitted
fix: Fix problematic error returns
Signed-off-by: cuishuang <[email protected]>
1 parent 07ac347 commit 20848b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/flatten/replace/replace.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ func UpdateRef(sp interface{}, key string, ref spec.Ref) error {
221221
debugLog("rewriting holder for %T", refable)
222222
_, entry, pvalue, erp := getParentFromKey(sp, key)
223223
if erp != nil {
224-
return err
224+
return erp
225225
}
226226
switch container := pvalue.(type) {
227227
case spec.Definitions:
@@ -275,7 +275,7 @@ func UpdateRefWithSchema(sp *spec.Swagger, key string, sch *spec.Schema) error {
275275
case spec.Schema:
276276
_, entry, pvalue, erp := getParentFromKey(sp, key)
277277
if erp != nil {
278-
return err
278+
return erp
279279
}
280280
switch container := pvalue.(type) {
281281
case spec.Definitions:

0 commit comments

Comments
 (0)