エラーコード

Estimated reading time: 7 minutes

REST API プロトコルでは、HTTP と JSON-RPC が使用されるため、2 つのレイヤーの状態コードを使用できます。 このページでは、エラーの様々な処理方法について説明し、主なエラーの例を示します。

概要

  • エラーコードは 0〜65535 の間で定義されています。エラーコードは 2 つの領域 (REST API システム領域とユーザー領域) に分けられます。
error code area
0 - 32767 REST API system area
32768 - 65535 user area
  • ユーザー領域は、共通領域と各サービスに分けられます。
error code area
32768 - 39999 Unused areas.
40000 - 40199 Service common areas.
40200 - 40399 System service area.
40400 - 40599 Camera service area.
40600 - 40799 videoScreen service area.
40800 - 40999 Audio service area.
41000 - 41199 avContent service area.
41200 - 41399 Recording service area.
41400 - 41599 appControl service area.
41600 - 41799 Browser service area.
42000 - 42199 accessControl service.
42200 - 42399 contentDownload service.
42400 - 42599 Encryption service.
42600 - 42799 contentSync service.
42800 - 42999 contentSync service.
43000 - 65535 A reserved area.
  • これはエラーコードの説明表の凡例です。
code Reason phrase example JSON example Explanation
Error code. This is the 1st Element of “error”. Example of the error reason message. This is the 2nd Element of “error”. Example of the “error” member’s response. This is shown in bold and italics. Explanation of the error case.

REST API の HTTP メジャーエラーコード

以下が基本方針です。

  • 元の HTTP 定義に従う
  • HTTP エラーへの対応を強制はしない

HTTP ステータスコードが 200 OK 以外の場合、HTTP サーバーが REST API プロトコルに従ってレスポンスボディを返します。 エラーコードは HTTP エラーコードと同じである必要があります。主なエラーコード以下のとおりです。

code Reason phrase example JSON example Explanation
401 Unauthorized “error”: [401, “Unauthorized”] Request requires user authentication.
403 Forbidden “error”: [403, “Forbidden”] Server understood the request, but is refusing to fulfill it. The client does not have permission to access.
404 Not Found “error”: [404, “Not Found”] For cases where the request is not matched to any supported API version.
413 Request Entity Too Large “error”: [413, “Request Entity Too Large”] The accepted body size of the client request exceeds the maximum limit.
414 Request-URI Too Long “error”: [414, “Request-URI Too Long”] The accepted URI length of the client request exceeds the maximum limit.
501 Not Implemented “error”: [501, “Not Implemented”] When the request method is not implemented on the server.
503 Service Unavailable “error”: [503, “Service Unavailable”] When the server is in a temporarily unavailable state which may occur due to other concurrent connections. (The number of maximum connections is not defined because it depends on the server.)

システムエラーコード

code Reason phrase example JSON Example Explanation
1 Any “error”: [1, “Any”] A generic error code which can be used with any error.
2 Timeout “error”: [2, “Timeout”] For cases when the server cannot reply in time.
3 Illegal Argument “error”: [3, “Illegal Argument”] For cases when the “params” value in the request does not follow API specifications.
5 Illegal Request “error”: [5, “Illegal Request”] For cases when the request body is empty, has no ID or has an invalid ID, has no method, has no params, or the params is not an array.
7 Illegal State “error”: [7, “Illegal State”] For cases when the server cannot handle the request at this time.
12 No Such Method “error”: [12, “No Such Method”] For cases when the requested API does not exist.
14 Unsupported Version “error”: [14, “Unsupported Version”] For cases when the requested version is not supported on the specified service.
15 Unsupported Operation “error”: [15, “Unsupported Operation”] For cases when the server cannot handle the request with respect to the specified parameters.

共通エラーコード

code Reason phrase example JSON Example Explanation
40000 Request Retry “error”: [40000, “Request Retry”] Long Polling timeout happens.
40001 Client Over Maximum “error”: [40001, “Clients Over Maximum”] The number of Long Polling clients exceeds the maximum limit.
40002 Encryption Failed “error”: [40002, “Encryption Failed”] Encryption error. Failed to encrypt/decrypt in the encryption API.
40003 Request Duplicated “error”: [40003, “Request Duplicated”] Client must wait for the previous response.
40004 Multiple Settings Failed “error”: [40004, “Multiple Settings Failed”] One or more settings are not set by error when multiple settings are set. The client needs to call paired APIs (getXXXSettings) to identify which parameters failed to be updated.
40005 Display is turned off “error”: [40005, “Display is turned off”] Display is turned off.
40006 Please contact the inquiry counter “error”: [40006, “Exxxx”] A common error code used among services to be used for general errors. This error code can be used only to identify general errors, but has different messages (like error codes) in “error_message” just for debugging or display purposes.

system サービスエラーコード

code Reason phrase example JSON Example Explanation
40200 Password expired “error”: [40200, “Password expired”] Password is expired.
40201 AC power required “error”: [40201, “AC power required”] Server cannot run this method without AC power.

videoScreen サービスエラーコード

code Reason phrase example JSON Example Explanation
40600 Screen Change in Progress “error”: [40600, “Screen Change in Progress”] Another request is in progress.

audio サービスエラーコード

code Reason phrase example JSON Example Explanation
40800 Target Not Supported “error”: [40800, “Target Not Supported”] Target is not supported or cannot be controlled for some device specific reason.
40801 Volume Out of Range “error”: [40801, “Volume Out of Range”] Volume is out of range.

avContentサービスエラーコード

code Reason phrase example JSON Example Explanation
41000 Content is Protected “error”: [41000, “Content is Protected”] Content is protected.
41001 Content does Not Exist “error”: [41001, “Content does Not Exist”] Content does not exist.
41002 Storage has no content. “error”: [41002, “Storage has no content.”] Storage has no content.
41003 Some content could not be deleted “error”: [41003, “Some content could not be deleted”] Some content could not be deleted.
41011 Channel Fixed by USB Recording “error”: [41011, “Channel Fixed by USB Recording”] Channel is fixed by USB recording.
41012 Channel Fixed by SCART Recording “error”: [41012, “Channel Fixed by SCART Recording”] Channel is fixed by SCART recording.
41013 Chapter doesn’t exist “error”: [41013, “Chapter doesn’t exist”] Chapter doesn’t exist.
41014 Channel can’t be uniquely determind. “error”: [41014, “Channel can’t be uniquely determind”] Channel can’t be uniquely determined.
41015 Empty Channel list. “error”: [41015, “Empty Channel list”] Empty channel list.
41020 Storage doesn’t exist “error”: [41020, “Storage doesn’t exist”] Storage doesn’t exist.
41021 Storage is full “error”: [41021, “Storage is full”] Storage is full.
41022 Content attribute setting failed. “error”: [41022, “Content attribute setting failed.”] Content attribute setting failed.
41023 Unknown group id. “error”: [41023, “Unknown group id.”] Unknown group ID.
41024 Content is not supported. “error”: [41024, “Unsupported content”] Content is not supported.

appControl サービスエラーコード

code Reason phrase example JSON Example Explanation
41400 Another Request in Progress “error”: [41400, “Another Request in Progress”] Another request is in progress.
41401 Failed to Launch “error”: [41401, “Failed to Launch”] Failed to launch, for example, because another application is running.
41402 Request In Progress “error”: [41402, “Request In Progress”] Request is accepted, but completion of the application’s launch cannot be decided.
41403 Failed to Terminate “error”: [41403, “Failed to Terminate”] Some applications can’t be terminated.

encryption サービスエラーコード

code Reason phrase example JSON Example Explanation
42400 Key doesn’t exist “error”: [42400, “Key doesn’t exist”] Key doesn’t exist yet.
Last modified: 4 Mar 2019