Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error message update #491

Merged
merged 2 commits into from
Jan 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 11 additions & 90 deletions spec/VISSv2_Transport.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,125 +162,45 @@ <h2>Status Codes</h2>
<th>Error Reason</th>
<th>Error Message</th>
</tr>
<tr>
<td>304 (Not Modified)</td>
<td>not_modified</td>
<td>No changes have been made by the server.</td>
</tr>
<tr>
<td>400 (Bad Request)</td>
<td>bad_request </td>
<td>The server is unable to fulfil the client request because the request is malformed.</td>
<td>The request is malformed.</td>
</tr>
<tr>
<td>400 (Bad Request)</td>
<td>filter_invalid</td>
<td>Filter requested on non-primitive type.</td>
</tr>
<tr>
<td>400 (Bad Request)</td>
<td>invalid_duration</td>
<td>Time duration is invalid.</td>
</tr>
<tr>
<td>400 (Bad Request)</td>
<td>invalid_value</td>
<td>The requested set value is invalid.</td>
<td>invalid_data</td>
<td>Data present in the request is invalid.</td>
</tr>
<tr>
<td>401 (Unauthorized)</td>
<td>token_expired</td>
<td>expired_token</td>
<td>Access token has expired.</td>
</tr>
<tr>
<td>401 (Unauthorized)</td>
<td>token_invalid</td>
<td>invalid_token</td>
<td>Access token is invalid.</td>
</tr>
<tr>
<td>401 (Unauthorized)</td>
<td>token_missing</td>
<td>missing_token</td>
<td>Access token is missing.</td>
</tr>
<tr>
<td>401 (Unauthorized)</td>
<td>too_many_attempts</td>
<td>The client has failed to authenticate too many times.</td>
</tr>
<tr>
<td>401 (Unauthorized)</td>
<td>read_only</td>
<td>The desired signal cannot be set since it is a read only signal.</td>
</tr>
<tr>
<td>403 (Forbidden)</td>
<td>user_forbidden</td>
<td>The user is not permitted to access the requested resource. Retrying does not help.</td>
</tr>
<tr>
<td>403 (Forbidden)</td>
<td>user_unknown</td>
<td>The user is unknown. Retrying does not help.</td>
</tr>
<tr>
<td>403 (Forbidden)</td>
<td>device_forbidden</td>
<td>The device is not permitted to access the requested resource. Retrying does not help.</td>
</tr>
<tr>
<td>403 (Forbidden)</td>
<td>device_unknown</td>
<td>The device is unknown. Retrying does not help.</td>
<td>forbidden_request</td>
<td>The server refuses to carry out the request.</td>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we state that this for example might be given if token does not give access to this operation/path/signal

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think that examples should be part of this text that is sent in the response.
If there is a need for giving examples I think it should be elsewhere in this chapter.

</tr>
<tr>
<td>404 (Not Found)</td>
<td>invalid_path</td>
<td>The specified data path does not exist.</td>
</tr>
<tr>
<td>404 (Not Found)</td>
<td>private_path</td>
<td>The specified data path is private and the request is not authorized to access signals on this path.</td>
</tr>
<tr>
<td>404 (Not Found)</td>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see two possible error situations here.

  • One is that the server does not know about the signal, like Vehicle/Zpeed
  • Another is that the path is correct (Vehicle/Speed), but server does not yet have any value for speed.

Will 404 be returned in both cases, or will the second case result in OK (200) but with empty result?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, its not path error so then one would lean towards 200 ...but then what is an empty result ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vehicle.Zpeed would lead to 404 unavaliable_data
Server not having any data for a correct path would also be 404.

<td>unavailable_data</td>
<td>The requested data was not found.</td>
</tr>
<tr>
<td>404 (Not Found)</td>
<td>invalid_subscriptionId</td>
<td>The specified subscription was not found.</td>
</tr>
<tr>
<td>406 (Not Acceptable)</td>
<td>insufficient_priviledges</td>
<td>The priviledges represented by the access token are not sufficient.</td>
</tr>
<tr>
<td>406 (Not Acceptable)</td>
<td>not_acceptable</td>
<td>The server is unable to generate content that is acceptable to the client</td>
</tr>
<tr>
<td>429 (Too Many Requests)</td>
<td>too_many_requests</td>
<td>The client has sent the server too many requests in a given amount of time.</td>
</tr>
<tr>
<td>502 (Bad Gateway)</td>
<td>bad_gateway</td>
<td>The server was acting as a gateway or proxy and received an invalid response from an upstream server.</td>
</tr>
<tr>
<td>503 (Service Unavailable)</td>
<td>service_unavailable</td>
<td>The server is currently unable to handle the request due to a temporary overload or scheduled maintenance (which may be alleviated after some delay).</td>
</tr>
<tr>
<td>504 (Gateway Timeout)</td>
<td>gateway_timeout</td>
<td>The server did not receive a timely response from an upstream server it needed to access in order to complete the request.</td>
<td>The server is temporarily unable to handle the request.</td>
</tr>
</tbody></table>
</section>
Expand Down Expand Up @@ -1677,7 +1597,8 @@ <h2>Action Definitions</h2>
<section id="error-def">
<h2>Error Definitions</h2>
<p>The error number SHOULD be a status code defined in [[RFC2616]], c. f. chapter "Status codes".
The error reason SHOULD be the corresponding reason-phrase from [[RFC2616]].
The error reason SHOULD be short. two or three words connected by underscor.
It SHOULD relate to the reason-phrase from [[RFC2616]] for the corresponding status code.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be useful with an example here. RFC2616 only presents recommended reason phrases right (see https://datatracker.ietf.org/doc/html/rfc2616#section-6.1.1), like "Forbidden" for 403. So what does "It SHOULD relate to the reason-phrase" actually mean? Can we say that forbidden_request is related to the recommended Forbidden in RFC2616

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say that forbidden_request relates to Forbidden in RFC2616.
To use examples I think is unnecessary, but you could try to add it.

The error message is meant to give a more precise description of the error.
</p>
<table class="simple">
Expand Down
Loading