MCPcopy Create free account
hub / github.com/fnproject/fn / GetAPIErrorCode

Function GetAPIErrorCode

api/models/error.go:253–259  ·  view source on GitHub ↗

GetAPIErrorCode returns 0 if an error is not an APIError, or the result of the Code() method from an APIError

(e error)

Source from the content-addressed store, hash-verified

251// GetAPIErrorCode returns 0 if an error is not an APIError, or the result
252// of the Code() method from an APIError
253func GetAPIErrorCode(e error) int {
254 err, ok := e.(APIError)
255 if ok {
256 return err.Code()
257 }
258 return 0
259}
260
261// FuncError is an error that is the function's fault, that uses the
262// APIError but distinguishes fault to function specific errors

Callers 4

enqueueCallResponseMethod · 0.92
runStatusCallMethod · 0.92
isTooBusyFunction · 0.92

Calls 1

CodeMethod · 0.65

Tested by 1