Skip to content

Commit

Permalink
fix:conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
constwz committed Nov 30, 2023
1 parent 0efd18f commit 954c4da
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
20 changes: 0 additions & 20 deletions base/types/gfsperrors/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,6 @@ func init() {
})
}

func GetGfSpErr(err error) *GfSpError {
if err == nil {
return nil
}
if gfspErr, ok := err.(*GfSpError); ok {
return gfspErr
}
i := strings.Index(err.Error(), "desc = ")
if i == -1 || len(err.Error())-1 < i+6 {
return nil
}
errInfo := err.Error()[i+6:]
var gfspErr GfSpError
unmarshalErr := json.Unmarshal([]byte(errInfo), &gfspErr)
if unmarshalErr == nil && gfspErr.HttpStatusCode != 0 {
return &gfspErr
}
return nil
}

// MakeGfSpError returns an GfSpError from the build-in error interface. It is
// difficult to predefine all errors. For undefined errors, there needs to be a
// way to capture them and return them to the client according to the GfSpError
Expand Down
1 change: 1 addition & 0 deletions modular/gater/metadata_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package gater
import (
"encoding/base64"
"encoding/xml"
"errors"
"fmt"
"log"
"math/big"
Expand Down

0 comments on commit 954c4da

Please sign in to comment.