Files
libopenapi/utils/unwrap_errors.go
quobix 8bbb022daa Addressed comments from review and fixed bug with schema props
props did not have context, therefore they had no idea where they were or where to resolve from.

Signed-off-by: quobix <dave@quobix.com>
2023-11-02 10:28:29 -04:00

16 lines
304 B
Go

// Copyright 2023 Princess B33f Heavy Industries / Dave Shanley
// SPDX-License-Identifier: MIT
package utils
func UnwrapErrors(err error) []error {
if err == nil {
return []error{}
}
if uw, ok := err.(interface{ Unwrap() []error }); ok {
return uw.Unwrap()
} else {
return []error{err}
}
}