func APIError(err error) (transport.APIError, error) {
	if err == nil {
		return transport.APIError{}, nil
	}
	if IsAPIError(err) {
		return err.(transport.APIError), nil
	}
	return transport.APIError{}, errors.Annotatef(err, "not valid APIError")
}
// APIError extracts an API error from the given error or returns an error.
APIError extracts an API error from the given error or returns an error.
// APIError extracts an API error from the given error or returns an error .
func APIError(err error) (transport.APIError, error) {
	if err == nil {
		return transport.APIError{}, nil
	}
	if IsAPIError(err) {
		return err.(transport.APIError), nil
	}
	return transport.APIError{}, errors.Annotatef(err, "not valid APIError")
}
func APIError ( err error ) ( transport . APIError , error ) { if err == nil { return transport . APIError { } , nil } if IsAPIError ( err ) { return err . ( transport . APIError ) , nil } return transport . APIError { } , errors . Annotatef ( err , " " ) }
APIError extracts an API error from the given error or returns an error.
APIError extracts an API error from the given error or returns an error .