From 6f7edb5aa64d0bbb0626417b1f1d6c89a9fc5496 Mon Sep 17 00:00:00 2001 From: Ulf Bjorkengren Date: Thu, 5 Dec 2024 10:43:02 +0100 Subject: [PATCH] Status code refactoring and update Signed-off-by: Ulf Bjorkengren --- spec/VISSv3.0_TransportExamples.html | 101 ++++++++++++++++++++++----- 1 file changed, 82 insertions(+), 19 deletions(-) diff --git a/spec/VISSv3.0_TransportExamples.html b/spec/VISSv3.0_TransportExamples.html index 4f8994e..36a3570 100644 --- a/spec/VISSv3.0_TransportExamples.html +++ b/spec/VISSv3.0_TransportExamples.html @@ -184,9 +184,10 @@

Transport Common Definitions

Status Codes

-

The server implementation SHALL support the error numbers listed in the table below, - with the associated reason and message fields, for all supported transport protocols.

-

The client SHOULD support any status code defined in [[RFC2616]].

+

A server implementing this specification SHALL support the error codes, + error reasons and error messages shown in the table below, for all supported transport protocols. + The server may choose to dynamically replace the error message as described in the sub-chapters
+ The client MAY support any status code defined in [[RFC2616]].

@@ -196,44 +197,106 @@

Status Codes

- + - - - - - - + - - - - - - + - + - + + + + + + + + + + + + + + + - + + + + + +
Error Number (Code)
400 (Bad Request) bad_request The request is malformed.The request is malformed
400 (Bad Request) invalid_dataData present in the request is invalid.
401 (Unauthorized)expired_tokenAccess token has expired.Data in the request is invalid
401 (Unauthorized) invalid_tokenAccess token is invalid.
401 (Unauthorized)missing_tokenAccess token is missing.Access token is invalid
403 (Forbidden) forbidden_requestThe server refuses to carry out the request.The server refuses to carry out the request
404 (Not Found) unavailable_dataThe requested data was not found.The requested data was not found
408 (Request Timeout)request_timeoutSubscribe duration limit exceeded
429 (Too Many Requests)too_many_requestsRate-limiting due to too many requests
502 (Bad Gateway) + bad_gatewayThe upsteam server response was invalid
503 (Service Unavailable) service_unavailableThe server is temporarily unable to handle the request.The server is temporarily unable to handle the request
504 (Gateway Timeout)gateway_timeoutThe upsteam server took too long to respond
+ +
+

400 Bad Request Error Messages

+

+ This error code and reason shall be used for JSON schema related errors. + The default error message is shown in the table above. The server may dynamically replace this by any of the error messages in the list below. +

+
    +
  • Missing or invalid action
  • +
  • Missing or invalid path
  • +
  • Missing or invalid filter
  • +
  • Missing or invalid value
  • +
+
+ +
+

400 Invalid Data Error Messages

+

+ This error code and reason shall be used for errors that are not covered by the JSON schema but e. g. breaks a rule set by a VSS property. + The default error message is shown in the table above. The server may dynamically replace this by any of the error messages in the list below. +

+
    +
  • Update of a sensor is not supported
  • +
  • Requested action on a branch is not supported
  • +
  • Data value outside limit
  • +
  • Incorrect data type
  • +
+
+ +
+

401 Unauthorized Error Messages

+

+ This error code and reason shall be used for errors related to access control validation. + The default error message is shown in the table above. The server may dynamically replace this by any of the error messages in the list below. +

+
    +
  • Access token has expired
  • +
  • Access token is missing
  • +
+
+ +
+

404 Not Found Error Messages

+

+ This error code and reason shall be used when the server do not have access to the requested data. + The default error message is shown in the table above. The server may dynamically replace this by any of the error messages in the list below. +

+
    +
  • Data temporarily unaccessible
  • +
  • Data is unknown
  • +
+