// GetErrorCode returns the value of ErrorCode if it is set or its
// zero value if it is unset.
330458
func (v *Xception2) GetErrorCode() (o int32) {
	if v != nil && v.ErrorCode != nil {
		return *v.ErrorCode
	}

	return
}
611380
func statusCode(e kerrors.Error) int {
	if e.Code > 0 {
		return e.Code
	}
	switch e.Reference {
	case kerrors.InternalError:
		return http.StatusInternalServerError
	case kerrors.InvalidData:
		return http.StatusUnprocessableEntity
	case kerrors.MalformedData:
		return http.StatusBadRequest
	case kerrors.Forbidden:
		return http.StatusForbidden
	case kerrors.NotFound:
		return http.StatusNotFound
	default:
		return http.StatusInternalServerError
	}
}
1018208
func (s *UnprocessedIdentityId) SetErrorCode(v string) *UnprocessedIdentityId {
	s.ErrorCode = &v
	return s
}
428152
func (s *Warning) SetErrorCode(v string) *Warning {
	s.ErrorCode = &v
	return s
}
30663
func (s *UnprocessedNamedQueryId) SetErrorCode(v string) *UnprocessedNamedQueryId {
	s.ErrorCode = &v
	return s
}
313881
func (s *StackError) SetErrorCode(v string) *StackError {
	s.ErrorCode = &v
	return s
}
693720
func ErrorToCode(err error) int {
	switch {
	case IsAggregate(err):
		return http.StatusGatewayTimeout
	case IsNotFound(err):
		return http.StatusNotFound
	case IsBadParameter(err) || IsOAuth2(err):
		return http.StatusBadRequest
	case IsNotImplemented(err):
		return http.StatusNotImplemented
	case IsCompareFailed(err):
		return http.StatusPreconditionFailed
	case IsAccessDenied(err):
		return http.StatusForbidden
	case IsAlreadyExists(err):
		return http.StatusConflict
	case IsLimitExceeded(err):
		return http.StatusTooManyRequests
	case IsConnectionProblem(err):
		return http.StatusGatewayTimeout
	default:
		return http.StatusInternalServerError
	}
}
318273
func (conn *OCI8Conn) getError(result C.sword) error {
	switch result {
	case C.OCI_SUCCESS:
		return nil
	case C.OCI_INVALID_HANDLE:
		return errors.New("OCI_INVALID_HANDLE")
	case C.OCI_SUCCESS_WITH_INFO:
		return ErrOCISuccessWithInfo
	case C.OCI_RESERVED_FOR_INT_USE:
		return errors.New("OCI_RESERVED_FOR_INT_USE")
	case C.OCI_NO_DATA:
		return errors.New("OCI_NO_DATA")
	case C.OCI_NEED_DATA:
		return errors.New("OCI_NEED_DATA")
	case C.OCI_STILL_EXECUTING:
		return errors.New("OCI_STILL_EXECUTING")
	case C.OCI_ERROR:
		errorCode, err := conn.ociGetError()
		switch errorCode {
		/*
			bad connection errors:
			ORA-00028: your session has been killed
			ORA-01012: Not logged on
			ORA-01033: ORACLE initialization or shutdown in progress
			ORA-01034: ORACLE not available
			ORA-01089: immediate shutdown in progress - no operations are permitted
			ORA-03113: end-of-file on communication channel
			ORA-03114: Not Connected to Oracle
			ORA-03135: connection lost contact
			ORA-12528: TNS:listener: all appropriate instances are blocking new connections
			ORA-12537: TNS:connection closed
		*/
		case 28, 1012, 1033, 1034, 1089, 3113, 3114, 3135, 12528, 12537:
			return driver.ErrBadConn
		}
		return err
	}
	return fmt.Errorf("received result code %d", result)
}
425268
func (e *Error) StatusCode() int {
	code, ok := errorTypeToStatusCodeMap[e.Type]
	if !ok || code == 0 {
		return 500
	}

	return code
}
431422
func getCode(path string) (*CodeDescriptor, error) {
	if path == "" {
		return nil, errors.New("Cannot collect files from empty chaincode path")
	}

	// code root will point to the directory where the code exists
	var gopath string
	gopath, err := getCodeFromFS(path)
	if err != nil {
		return nil, fmt.Errorf("Error getting code %s", err)
	}

	return &CodeDescriptor{Gopath: gopath, Pkg: path, Cleanup: nil}, nil
}
295729
func getErrorText(m map[string]json.RawMessage) string {

	quoted, ok := m["errortext"]
	if !ok {
		return ""
	}

	errortext, err := strconv.Unquote(string(quoted))
	if err != nil {
		return string(quoted)
	}
	return errortext
}
605352
func GetErrorCodeGroup(name string) []ErrorDescriptor {
	desc := groupToDescriptors[name]
	sort.Sort(byValue(desc))
	return desc
}
560602
func (s *FailedScheduledUpdateGroupActionRequest) SetErrorCode(v string) *FailedScheduledUpdateGroupActionRequest {
	s.ErrorCode = &v
	return s
}
212941
func (s *UnprocessedTraceSegment) SetErrorCode(v string) *UnprocessedTraceSegment {
	s.ErrorCode = &v
	return s
}
838601
func (s *ImportFindingsError) SetErrorCode(v string) *ImportFindingsError {
	s.ErrorCode = &v
	return s
}
999132
func IsErrorWithCode(err error, desiredResultCode uint8) bool {
	if err == nil {
		return false
	}

	serverError, ok := err.(*Error)
	if !ok {
		return false
	}

	return serverError.ResultCode == desiredResultCode
}
259057
func (s *PutRecordsResultEntry) SetErrorCode(v string) *PutRecordsResultEntry {
	s.ErrorCode = &v
	return s
}