enum AsleepError: Error {
case unknown(systemError: Error)
case shouldResume
case over24hours
case responseResult(endpoint: String)
case httpStatus(code: Int, errorCode: Int, message: String?)
}
unknown: 알 수 없는 시스템 에러
systemError: Error - 시스템이 발생한 에러
shouldResume: 마이크 녹음 인터럽트 이후 재개할 수 없음
over24Hours: 녹음이 24시간 초과되어 강제 중지함
에이슬립 SDK는 24시간을 초과하는 수면 측정을 지원하지 않습니다.
responseResult: api reponse의 result값에 문제가 발생함
endpoint - 문제가 발생한 endpoint
httpStatus: http 에러
code: Int - 400 이상의 http code
errorCode: Int - 상세 에러 코드 - 개발중
message: String - 에러 사유 설명
HTTP Status code
Code
Error code(TBD)
Type
Description
401
Unauthorized
권한이 없음
403
Plan is expired
Plan이 만료됨
403
Rate limit exceeded
Rate limit 초과됨
403
Quota exceeded
Quota 초과됨
401
Unauthorized
유효하지 않은 customer uuid
401
Unauthorized
user_agent 가 비어있음
409
Conflict
이전 수면 세션이 아직 닫히지 않았음
422
Validation Error
유효하지 않은 세션 시작 시간 (YYYY-MM-DDTHH:mm:ssz)
422
Validation Error
유효하지 않은 parameter
403
Forbidden
세션이 이미 종료됨
404
Not Found
세션이 존재하지 않음
400
Bad Request
유효하지 않은 callback_url
400
Bad Request
오디오 형식은 <sleep_session.sleep_sound_length> sec (16khz, 44.1khz, 48khz) (mp3, wav) 10MB 미만이여야됨
400
Bad Request
MELSPECTROGRAM file는 업로드 할 수 없음. AUDIO file만 업로드 가능함.
413
Request Entity Too Large
HTTP 콘텐츠 길이가 1677721은6 bytes를 초과함
422
Unprocessable Entity
유효하지 않은 parameter
403
Forbidden
수면 세션이 이미 종료됨
400
Bad Request
[경고] 유효하지 않은 세션 종료 시간. 종료시간 (YYYY-MM-DDTHH:mm:ssz)은 세션 시작 시간보다 작아야됨