// Code generated by "enumer -type=RocksDBErrCode -output=rocskdb_err_string.go"; DO NOT EDIT

package base

import (
	"fmt"
)

// Pegasus always returns rocksdb error in `resp.Error`, for data operations like PUT, GET.

const _RocksDBErrCode_name = "OkNotFoundCorruptionNotSupportedInvalidArgumentIOErrorMergeInProgressIncompleteShutdownInProgressTimedOutAbortedBusyExpiredTryAgain"

var _RocksDBErrCode_index = [...]uint8{0, 2, 10, 20, 32, 47, 54, 69, 79, 97, 105, 112, 116, 123, 131}

func (i RocksDBErrCode) String() string {
	if i < 0 || i >= RocksDBErrCode(len(_RocksDBErrCode_index)-1) {
		return fmt.Sprintf("RocksDBErrCode(%d)", i)
	}
	return _RocksDBErrCode_name[_RocksDBErrCode_index[i]:_RocksDBErrCode_index[i+1]]
}

var _RocksDBErrCodeNameToValue_map = map[string]RocksDBErrCode{
	_RocksDBErrCode_name[0:2]:     0,
	_RocksDBErrCode_name[2:10]:    1,
	_RocksDBErrCode_name[10:20]:   2,
	_RocksDBErrCode_name[20:32]:   3,
	_RocksDBErrCode_name[32:47]:   4,
	_RocksDBErrCode_name[47:54]:   5,
	_RocksDBErrCode_name[54:69]:   6,
	_RocksDBErrCode_name[69:79]:   7,
	_RocksDBErrCode_name[79:97]:   8,
	_RocksDBErrCode_name[97:105]:  9,
	_RocksDBErrCode_name[105:112]: 10,
	_RocksDBErrCode_name[112:116]: 11,
	_RocksDBErrCode_name[116:123]: 12,
	_RocksDBErrCode_name[123:131]: 13,
}

func RocksDBErrCodeString(s string) (RocksDBErrCode, error) {
	if val, ok := _RocksDBErrCodeNameToValue_map[s]; ok {
		return val, nil
	}
	return 0, fmt.Errorf("%s does not belong to RocksDBErrCode values", s)
}
