type ServiceError … // NewError returns a ServiceError using the code and reason func NewError(code int, message string) ServiceError { … } // NewErrorWithHeader returns a ServiceError using the code, reason and header func NewErrorWithHeader(code int, message string, header http.Header) ServiceError { … } // Error returns a text representation of the service error func (s ServiceError) Error() string { … }