Error Codes
Asleep.setDebugLoggerDelegate()
let delegate: AsleepDebugLoggerDelegate = self
Asleep.setDebugLoggerDelegate(self)
protocol AsleepDebugLoggerDelegate {
func didPrint(message: String)
}
Property Name | Type | Description |
---|---|---|
message | String | Log message |
Asleep.AsleepError
enum AsleepError: Error {
case unknown(systemError: Error)
case shouldResume
case over24hours
case responseResult(endpoint: String)
case httpStatus(code: Int, errorCode: Int, message: String?)
}
unknown: Unknown system error
- systemError: Error - error due to system
shouldResume: unable to resume microphone recording after interrupt
over24Hours: recording exceeded 24 hours and is forcibly stopped
- The Asleep SDK does not support sleep tracking exceeding 24 hours.
responseResult: error due to api reponse result value
- endpoint - The endpoint where the problem occurred
httpStatus: http error
- code: Int - 400 or more http code
- errorCode: Int - specific error code - in dev
- message: String - error reason explanation
HTTP Status code
Code | Error code(TBD) | Type | Description |
---|---|---|---|
401 | Unauthorized | Unauthorized | |
403 | Plan is expired | Plan is expired | |
403 | Rate limit exceeded | Rate limit exceeded | |
403 | Quota exceeded | Quota exceeded | |
401 | Unauthorized | Not authorized customer uuid | |
401 | Unauthorized | user_agent is empty | |
409 | Conflict | Previous sleep session not yet closed | |
422 | Validation Error | Invalid session start time (YYYY-MM-DDTHH:mm:ssz) | |
422 | Validation Error | Invalid parameter | |
403 | Forbidden | Session already terminated | |
404 | Not Found | Session does not exist | |
400 | Bad Request | Not valid callback_url | |
400 | Bad Request | Audio format <sleep_session.sleep_sound_length> sec (16khz, 44.1khz, 48khz) (mp3, wav) less than 10MB | |
400 | Bad Request | MELSPECTROGRAM file cannot be uploaded. Only AUDIO file can be uploaded. | |
413 | Request Entity Too Large | HTTP length exceeded 16777216 bytes | |
422 | Unprocessable Entity | Not valid parameter | |
403 | Forbidden | Sleep session has already ended | |
400 | Bad Request | [WARNING] Invalid session end time. format(YYYY-MM-DDTHH:mm:ssz), 'session_end_time' must always be greater than 'session_start_time' | |
404 | Not Found | Session doesn't exist | |
400 | Bad Request | Invalid time zone provided | |
401 | Unauthorized | API key is not provided | |
404 | Not Found | sleep session id {session_id} cannot be found | |
422 | Unprocessable Entity | id {session_id}format is not valid |
Updated about 1 year ago