rename api.ApiError to api.Error

This commit is contained in:
Damian Bednarczyk
2023-11-29 15:03:44 -06:00
parent 382d5f3744
commit 439ec61de9
2 changed files with 9 additions and 6 deletions

View File

@@ -8,7 +8,7 @@ import (
"reflect"
)
type APIError struct {
type Error struct {
Success bool `json:"success"`
Error ErrorDetails `json:"error"`
}
@@ -25,7 +25,7 @@ func CreateAPIErrReader(err error) io.ReadCloser {
}
baseErr := getBaseError(err)
apiErr := APIError{
apiErr := Error{
Success: false,
Error: ErrorDetails{
Message: err.Error(),
@@ -50,6 +50,7 @@ func getBaseError(err error) error {
if unwrapped == nil {
return err
}
err = unwrapped
}
}