Skip to content

오류 처리 (Unity) ​

모든 API는 실패하면 WKError를 던져요.

csharp
try { await api.Storage.SetAsync("save", save); }
catch (WKError e) when (e.Code == "VERSION_CONFLICT") { /* 다시 읽어서 합치기 */ }
catch (WKError e) when (e.Retryable) { /* 잠시 후 다시 */ }
catch (WKError e) { Debug.LogError($"{e.Code} {e.Message} trace={e.TraceId}"); }
속성설명
Code서버 오류 코드 또는 SDK 코드
StatusHTTP 상태 (네트워크 오류는 0)
Retryable네트워크·5xx·429 — 잠시 후 다시 시도
TraceId문의할 때 함께 전달
Details추가 정보 (current_version, retry_after 등)

SDK 코드 ​

Code뜻
NETWORK_ERROR네트워크 끊김·타임아웃
NOT_LOGGED_IN로그인 전 호출
NOT_SUPPORTED설치·설정되지 않은 기능 (스토어·광고 모듈 없음, GrantHandler 미등록)
STORE_ERRORUnity IAP 오류
CANCELED유저가 결제를 취소

서버 오류 코드는 오류 코드를 보세요.

api.BackgroundError — 로그인 직후 자동 복구(결제·광고 보상)에서 난 오류를 알려 줘요.

© WEBZEN K. All rights reserved.