You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
316 lines
12 KiB
Go
316 lines
12 KiB
Go
package icserror
|
|
|
|
const (
|
|
ICS_ERROR_COMMON = iota
|
|
ICS_ERROR_CONFIG = ICS_ERROR_COMMON + 1000
|
|
ICS_ERROR_SVC = ICS_ERROR_COMMON + 2000
|
|
ICS_ERROR_UTIL = ICS_ERROR_COMMON + 2500
|
|
ICS_ERROR_APP = ICS_ERROR_COMMON + 3000
|
|
ICS_ERROR_DB = ICS_ERROR_COMMON + 3500
|
|
ICS_ERROR_NET = ICS_ERROR_COMMON + 4000
|
|
ICS_ERROR_RECORDDATA = ICS_ERROR_COMMON + 4500
|
|
ICS_ERROR_TTS = ICS_ERROR_COMMON + 5000
|
|
ICS_ERROR_STT = ICS_ERROR_COMMON + 5500
|
|
ICS_ERROR_WEBSOCKET = ICS_ERROR_COMMON + 6000
|
|
ICS_ERROR_SIP_PARSER = ICS_ERROR_COMMON + 6500
|
|
ICS_ERROR_SDP_PARSER = ICS_ERROR_COMMON + 7000
|
|
ICS_ERROR_RTP_PARSER = ICS_ERROR_COMMON + 7500
|
|
ICS_ERROR_CONV = ICS_ERROR_COMMON + 8000
|
|
ICS_ERROR_SESS = ICS_ERROR_COMMON + 8500
|
|
ICS_ERROR_EVENT = ICS_ERROR_COMMON + 9000
|
|
ICS_ERROR_HTTP_CLIENT = ICS_ERROR_COMMON + 9500
|
|
ICS_ERROR_STTMSG_PARSER = ICS_ERROR_COMMON + 10000
|
|
ICS_ERROR_STTUDP_PARSER = ICS_ERROR_COMMON + 10500
|
|
ICS_ERROR_TTS_PARSER = ICS_ERROR_COMMON + 11000
|
|
ICS_ERROR_S3 = ICS_ERROR_COMMON + 11500
|
|
)
|
|
|
|
// common error
|
|
const (
|
|
ICSOK = iota + ICS_ERROR_COMMON
|
|
ICSFALSE
|
|
ICS_ERROR_NOTFOUND_HOME
|
|
ICS_ERROR_INVALID_PARAM
|
|
ICS_ERROR_FILE_OPEN
|
|
ICS_ERROR_MAKE_DIR
|
|
ICS_ERROR_WRITE_FILE
|
|
ICS_ERROR_STRING_CONV
|
|
ICS_ERROR_DAEMONIZE
|
|
ICS_ERROR_INVALID_DATA
|
|
)
|
|
|
|
var (
|
|
ICSERRTest = NewIcsError("This Is Error Test", ICSOK)
|
|
ICSERRNotFoundHome = NewIcsError("Not found HOME Directory", ICS_ERROR_NOTFOUND_HOME)
|
|
ICSERRInvalidParam = NewIcsError("Invalid Parameter", ICS_ERROR_INVALID_PARAM)
|
|
ICSERRFileOpen = NewIcsError("File Open Error", ICS_ERROR_FILE_OPEN)
|
|
ICSERRMakeDir = NewIcsError("Make Dir Error", ICS_ERROR_MAKE_DIR)
|
|
ICSERRWriteFile = NewIcsError("File Write Error", ICS_ERROR_WRITE_FILE)
|
|
ICSERRStrConv = NewIcsError("Atoi Error", ICS_ERROR_STRING_CONV)
|
|
ICSERRDeamonize = NewIcsError("Process Deamonize Error", ICS_ERROR_DAEMONIZE)
|
|
ICSERRInvalidData = NewIcsError("There is not valid data", ICS_ERROR_INVALID_DATA)
|
|
)
|
|
|
|
// config error
|
|
const (
|
|
ICS_ERROR_CONFIG_FILE_NOTFOUND = iota + ICS_ERROR_CONFIG
|
|
ICS_ERROR_CONFIG_OPEN_FILE
|
|
ICS_ERROR_CONFIG_UNMARSHAL
|
|
)
|
|
|
|
var (
|
|
ICSERRCONFFileNotFound = NewIcsError("icsconfig: Not Found The Config File ", ICS_ERROR_CONFIG_FILE_NOTFOUND)
|
|
ICSERRCONFOpenFile = NewIcsError("icsconfig: Configuration File Open Error", ICS_ERROR_CONFIG_OPEN_FILE)
|
|
ICSERRCONFUnmarshal = NewIcsError("icsconfig: Config File Unmarshal Error", ICS_ERROR_CONFIG_UNMARSHAL)
|
|
)
|
|
|
|
// service error
|
|
const (
|
|
ICS_ERROR_SVC_WRONG_TIME = iota + ICS_ERROR_SVC
|
|
)
|
|
|
|
var (
|
|
ICSERRSVCTime = NewIcsError("icsservice: Wrong time", ICS_ERROR_SVC_WRONG_TIME)
|
|
)
|
|
|
|
// util error
|
|
const (
|
|
ICS_ERROR_UTIL_DISK_FULL = iota + ICS_ERROR_UTIL
|
|
)
|
|
|
|
var (
|
|
ICSERRUTILDiskFull = NewIcsError("icsutil: Disk Full", ICS_ERROR_UTIL_DISK_FULL)
|
|
)
|
|
|
|
// app error
|
|
const (
|
|
ICS_ERROR_APP_HTTP = iota + ICS_ERROR_APP
|
|
)
|
|
|
|
var (
|
|
ICSERRAPPHTTP = NewIcsError("icsapp: HTTP Listen", ICS_ERROR_APP_HTTP)
|
|
)
|
|
|
|
const (
|
|
ICS_ERROR_DB_OPEN = iota + ICS_ERROR_DB
|
|
ICS_ERROR_DB_CLOSE
|
|
ICS_ERROR_DB_INIT
|
|
ICS_ERROR_DB_WRITE
|
|
)
|
|
|
|
var (
|
|
ICSERRDBOpen = NewIcsError("icsdb: DB Open Error", ICS_ERROR_DB_OPEN)
|
|
ICSERRDBClose = NewIcsError("icsdb: DB Close Error", ICS_ERROR_DB_CLOSE)
|
|
ICSERRDBNotInit = NewIcsError("icsdb: DB Not Initialized", ICS_ERROR_DB_INIT)
|
|
ICSERRDBWrite = NewIcsError("icsdb: Write Error", ICS_ERROR_DB_WRITE)
|
|
)
|
|
|
|
// net error
|
|
const (
|
|
ICS_ERROR_NET_RESOLVEADDR = iota + ICS_ERROR_NET
|
|
ICS_ERROR_NET_LISTEN
|
|
ICS_ERROR_NET_CONNECT
|
|
ICS_ERROR_NET_NOT_CONNECTED
|
|
ICS_ERROR_NET_CLOSE
|
|
ICS_ERROR_NET_WRITE
|
|
ICS_ERROR_NET_READ
|
|
ICS_ERROR_NET_ACCEPT
|
|
ICS_ERROR_NET_NOT_FOUND_IF
|
|
ICS_ERROR_NET_GET_ADDR
|
|
)
|
|
|
|
var (
|
|
ICSERRNETResolveAddrError = NewIcsError("icsnet: Resolve Address Error", ICS_ERROR_NET_RESOLVEADDR)
|
|
ICSERRNETListenError = NewIcsError("icsnet: Listen Error", ICS_ERROR_NET_LISTEN)
|
|
ICSERRNETConnectError = NewIcsError("icsnet: Connect Error", ICS_ERROR_NET_CONNECT)
|
|
ICSERRNETNotConnectError = NewIcsError("icsnet: Connection is not completed yet", ICS_ERROR_NET_NOT_CONNECTED)
|
|
ICSERRNETCloseError = NewIcsError("icsnet: Close Error", ICS_ERROR_NET_CLOSE)
|
|
ICSERRNETWriteError = NewIcsError("icsnet: Write Error", ICS_ERROR_NET_WRITE)
|
|
ICSERRNETReadError = NewIcsError("icsnet: Read Error", ICS_ERROR_NET_READ)
|
|
ICSERRNETAcceptError = NewIcsError("icsnet: Accept Error", ICS_ERROR_NET_ACCEPT)
|
|
ICSERRNETNotFoundIF = NewIcsError("icsnet: Not Found Interface", ICS_ERROR_NET_NOT_FOUND_IF)
|
|
ICSERRNETGetAddr = NewIcsError("icsnet: Could Not Get Address", ICS_ERROR_NET_GET_ADDR)
|
|
)
|
|
|
|
// recorddata error
|
|
const (
|
|
ICS_ERROR_RECORDDATA_CALLSIGNAL_PARSING = iota + ICS_ERROR_RECORDDATA
|
|
)
|
|
|
|
var (
|
|
ICSERRRECORDDATAParsing = NewIcsError("recorddata: Parsing Error", ICS_ERROR_RECORDDATA_CALLSIGNAL_PARSING)
|
|
)
|
|
|
|
// tts error
|
|
const (
|
|
ICS_ERROR_TTS_CONTINUE = iota + ICS_ERROR_TTS
|
|
ICS_ERROR_TTS_OK
|
|
ICS_ERROR_TTS_FAIL
|
|
ICS_ERROR_TTS_FAIL_EINTR
|
|
ICS_ERROR_TTS_FAIL_EMPTY
|
|
ICS_ERROR_TTS_FAIL_INITIALIZE
|
|
ICS_ERROR_TTS_NOT_INITIALIZE
|
|
ICS_ERROR_TTS_ALREADY_CLOSED
|
|
ICS_ERROR_TTS_MP3_CONV
|
|
)
|
|
|
|
var (
|
|
ICSERRTTSContinue = NewIcsError("tts: Processing Synthesis", ICS_ERROR_TTS_CONTINUE)
|
|
ICSERRTTSOK = NewIcsError("tts: Synthesis Completed", ICS_ERROR_TTS_OK)
|
|
ICSERRTTSFail = NewIcsError("tts: Synthesis Failed", ICS_ERROR_TTS_FAIL)
|
|
ICSERRTTSFailEINTR = NewIcsError("tts: Synthesis Failed. Interrupted System Call", ICS_ERROR_TTS_FAIL_EINTR)
|
|
ICSERRTTSFailEmpty = NewIcsError("tts: Synthesis Failed. No Voice", ICS_ERROR_TTS_FAIL_EMPTY)
|
|
ICSERRTTSFailInit = NewIcsError("tts: Initialized Error", ICS_ERROR_TTS_FAIL_INITIALIZE)
|
|
ICSERRTTSNotInit = NewIcsError("tts: Not Initialized ", ICS_ERROR_TTS_NOT_INITIALIZE)
|
|
ICSERRTTSAlreadyClosed = NewIcsError("tts: Already Closed ", ICS_ERROR_TTS_ALREADY_CLOSED)
|
|
ICSERRTTSMP3Conv = NewIcsError("tts: MP3 Decoding Error", ICS_ERROR_TTS_MP3_CONV)
|
|
)
|
|
|
|
// stt error
|
|
const (
|
|
ICS_ERROR_STT_CONTINUE = iota + ICS_ERROR_STT
|
|
ICS_ERROR_STT_BARGEIN
|
|
ICS_ERROR_STT_OK
|
|
ICS_ERROR_STT_FAIL
|
|
ICS_ERROR_STT_FAIL_EMPTY
|
|
ICS_ERROR_STT_SEND_FAIL
|
|
ICS_ERROR_STT_FAIL_INITIALIZE
|
|
ICS_ERROR_STT_CONNECT_TIMEOUT
|
|
ICS_ERROR_STT_CONNECT_FAIL
|
|
ICS_ERROR_STT_CONNECT_CLOSE_FAIL
|
|
ICS_ERROR_STT_NOT_INITIALIZE
|
|
ICS_ERROR_STT_FREE_ERROR
|
|
ICS_ERROR_STT_ALREADY_CLOSED
|
|
ICS_ERROR_STT_LANGUAGE_SETTING
|
|
)
|
|
|
|
var (
|
|
ICSERRSTTContinue = NewIcsError("stt: Processing Recognition", ICS_ERROR_STT_CONTINUE)
|
|
ICSERRSTTBargeIn = NewIcsError("stt: Barge-In Occurred", ICS_ERROR_STT_BARGEIN)
|
|
ICSERRSTTOK = NewIcsError("stt: Recognition Completed", ICS_ERROR_STT_OK)
|
|
ICSERRSTTFail = NewIcsError("stt: Recoognition Failed", ICS_ERROR_STT_FAIL)
|
|
ICSERRSTTFailEmpty = NewIcsError("stt: Recoognition Failed. No Voice", ICS_ERROR_STT_FAIL_EMPTY)
|
|
ICSERRSTTSendFail = NewIcsError("stt: Initialized Error", ICS_ERROR_STT_SEND_FAIL)
|
|
ICSERRSTTFailInit = NewIcsError("stt: Initialized Error", ICS_ERROR_STT_FAIL_INITIALIZE)
|
|
ICSERRSTTConnectTimeout = NewIcsError("stt: Connection timeout", ICS_ERROR_STT_CONNECT_TIMEOUT)
|
|
ICSERRSTTConnectFail = NewIcsError("stt: Connection timeout", ICS_ERROR_STT_CONNECT_FAIL)
|
|
ICSERRSTTConnectCloseFail = NewIcsError("stt: Connection close fail", ICS_ERROR_STT_CONNECT_CLOSE_FAIL)
|
|
ICSERRSTTNotInit = NewIcsError("stt: Not Initialized ", ICS_ERROR_STT_NOT_INITIALIZE)
|
|
ICSERRSTTFreeError = NewIcsError("stt: Free Error ", ICS_ERROR_STT_FREE_ERROR)
|
|
ICSERRSTTAlreadyClosed = NewIcsError("stt: Already Closed ", ICS_ERROR_STT_ALREADY_CLOSED)
|
|
ICSERRSTTLanguageSetting = NewIcsError("stt: Language Setting Failed ", ICS_ERROR_STT_LANGUAGE_SETTING)
|
|
)
|
|
|
|
// websocket error
|
|
const (
|
|
ICS_ERROR_WEBSOCKET_CONNECT_FAIL = iota + ICS_ERROR_WEBSOCKET
|
|
ICS_ERROR_WEBSOCKET_NOT_CONNECT
|
|
ICS_ERROR_WEBSOCKET_CLOSE
|
|
ICS_ERROR_WEBSOCKET_READ
|
|
ICS_ERROR_WEBSOCKET_WRITE
|
|
ICS_ERROR_WEBSOCKET_NOT_SUPPORTED_MSG_TYPE
|
|
)
|
|
|
|
var (
|
|
ICSERRWEBSOCKETConnectFailError = NewIcsError("icsws: Failed to Connect to host", ICS_ERROR_WEBSOCKET_CONNECT_FAIL)
|
|
ICSERRWEBSOCKETNotConnectError = NewIcsError("icsws: Not Connected Yet", ICS_ERROR_WEBSOCKET_NOT_CONNECT)
|
|
ICSERRWEBSOCKETNotClose = NewIcsError("icsws: Could Not Close", ICS_ERROR_WEBSOCKET_CLOSE)
|
|
ICSERRWEBSOCKETReadError = NewIcsError("icsws: Failed to Read", ICS_ERROR_WEBSOCKET_READ)
|
|
ICSERRWEBSOCKETWriteError = NewIcsError("icsws: Failed to Write", ICS_ERROR_WEBSOCKET_WRITE)
|
|
ICSERRWEBSOCKETSupportedMsgType = NewIcsError("icsws: Failed to Write", ICS_ERROR_WEBSOCKET_NOT_SUPPORTED_MSG_TYPE)
|
|
)
|
|
|
|
// sip parsing error
|
|
var (
|
|
ICSERRSIPHeader = NewIcsError("icssip: Header format Error", ICS_ERROR_SIP_PARSER)
|
|
ICSERRINVITERequired = NewIcsError("icssip: INVITE Method required SDP", ICS_ERROR_SIP_PARSER)
|
|
ICSERR200OKRequired = NewIcsError("icssip: 200 OK Method required SDP", ICS_ERROR_SIP_PARSER)
|
|
)
|
|
|
|
// sdp parsing error
|
|
var (
|
|
ICSERRSDPParser = NewIcsError("icssdp: Data parser Error", ICS_ERROR_SDP_PARSER)
|
|
ICSERRNotFoundSdpMedia = NewIcsError("icssdp: Not Found SDP Media audio tag", ICS_ERROR_SDP_PARSER)
|
|
ICSERRSDPAudiotagPortValue = NewIcsError("icssdp: SDP Media audio tag port is not numeric", ICS_ERROR_SDP_PARSER)
|
|
)
|
|
|
|
// rtp parser error
|
|
const (
|
|
ICS_ERROR_RTP_NO = iota + ICS_ERROR_RTP_PARSER
|
|
)
|
|
|
|
var (
|
|
ICSERRRTPNo = NewIcsError("icsrtp: This packet may be not RTP", ICS_ERROR_RTP_NO)
|
|
)
|
|
|
|
// media converter error
|
|
const (
|
|
ICS_ERROR_CONV_NOT_SUPPORTED_CODEC = iota + ICS_ERROR_CONV
|
|
ICS_ERROR_CONV_DECODE
|
|
)
|
|
|
|
var (
|
|
ICSERRCONVNotSupportedCodec = NewIcsError("icsmediaconv: Not Supported codec", ICS_ERROR_CONV_NOT_SUPPORTED_CODEC)
|
|
ICSERRCONVDecodeFail = NewIcsError("icsmediaconv: Decoding Fail", ICS_ERROR_CONV_DECODE)
|
|
)
|
|
|
|
// session error
|
|
const (
|
|
ICS_ERROR_SESS_NOT_FOUND_SESSION = iota + ICS_ERROR_SESS
|
|
ICS_ERROR_SESS_SESSION_MAX_IDLE
|
|
ICS_ERROR_SESS_SESSION_NUM_EXCEED
|
|
)
|
|
|
|
var (
|
|
ICSERRSESSNotFoundSession = NewIcsError("icssessionmanager: Not Found Session", ICS_ERROR_SESS_NOT_FOUND_SESSION)
|
|
ICSERRSESSMaxSessionIdle = NewIcsError("icssessionmanager: Exceeded Session Max Idling Time", ICS_ERROR_SESS_SESSION_MAX_IDLE)
|
|
ICSERRSESSMaxSessionNumber = NewIcsError("icssessionmanager: Licensed Channel Number Exceeded ", ICS_ERROR_SESS_SESSION_NUM_EXCEED)
|
|
)
|
|
|
|
// event error
|
|
const (
|
|
ICS_ERROR_EVT_ALLOC = iota + ICS_ERROR_EVENT
|
|
ICS_ERROR_EVT_REMOVE
|
|
ICS_ERROR_EVT_POST
|
|
ICS_ERROR_EVT_NOT_INITIALIZE
|
|
ICS_ERROR_EVT_UNKNOWN
|
|
)
|
|
|
|
var (
|
|
ICSERREVTAlloc = NewIcsError("icsevent: Event Allocation Error", ICS_ERROR_EVT_ALLOC)
|
|
ICSERREVTRemove = NewIcsError("icsevent: Event Remove Error", ICS_ERROR_EVT_REMOVE)
|
|
ICSERREVTPost = NewIcsError("icsevent: Event Post Error", ICS_ERROR_EVT_POST)
|
|
ICSERREVTNotInit = NewIcsError("icsevent: Event System Not Initialized", ICS_ERROR_EVT_NOT_INITIALIZE)
|
|
ICSERREVTUnkown = NewIcsError("icsevent: Unkown Error", ICS_ERROR_EVT_UNKNOWN)
|
|
)
|
|
|
|
// http client
|
|
const (
|
|
ICS_ERROR_HTTP_CLIENT_RESPONSE = iota + ICS_ERROR_HTTP_CLIENT
|
|
ICS_ERROR_HTTP_CLIENT_CREATE
|
|
ICS_ERROR_HTTP_CLIENT_MARSHAL
|
|
ICS_ERROR_HTTP_CLIENT_UNMARSHAL
|
|
ICS_ERROR_HTTP_CLIENT_EXCUTION
|
|
ICS_ERROR_HTTP_CLIENT_READBODY
|
|
)
|
|
|
|
var (
|
|
ICSERRHTTPClientResponse = NewIcsError("icshttpclient: No Response", ICS_ERROR_HTTP_CLIENT_RESPONSE)
|
|
ICSERRHTTPClientCreate = NewIcsError("icshttpclient: http.NewRequest", ICS_ERROR_HTTP_CLIENT_CREATE)
|
|
ICSERRHTTPClientMarshal = NewIcsError("icshttpclient: Data Marshal", ICS_ERROR_HTTP_CLIENT_MARSHAL)
|
|
ICSERRHTTPClientUnmarshal = NewIcsError("icshttpclient: Data Unmarshal", ICS_ERROR_HTTP_CLIENT_UNMARSHAL)
|
|
ICSERRHTTPClientExcecution = NewIcsError("icshttpclient: Request http", ICS_ERROR_HTTP_CLIENT_EXCUTION)
|
|
ICSERRHTTPClientReadBody = NewIcsError("icshttpclient: Read Response Body", ICS_ERROR_HTTP_CLIENT_READBODY)
|
|
)
|
|
|
|
// s3
|
|
const (
|
|
ICS_ERROR_S3_CONNECT = iota + ICS_ERROR_S3
|
|
ICS_ERROR_S3_WRITE
|
|
)
|
|
|
|
var (
|
|
ICSERRORS3Connect = NewIcsError("icsaws: Connect error", ICS_ERROR_S3_CONNECT)
|
|
ICSERRORS3Write = NewIcsError("icsaws: File Write error", ICS_ERROR_S3_WRITE)
|
|
)
|