Skip to content

Define error response message format - closes #67 #76

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

benfrancis
Copy link
Member

@benfrancis benfrancis commented May 22, 2025

Closes #67.

This PR defines a format for error message responses.

As in the strawman proposal the Problem Details Format is used for error messages.

Unlike the strawman proposal (but as discussed in #42), rather than having a dedicated messageType, the messageType is set to response and the operation member set to the name of the operation being carried out when the error was experienced then an error member contains the error information.

I have re-used the same set of HTTP error codes recommended in WoT Profiles, with the exception of 401 Unauthorized which would make more sense when opening the WebSocket connection rather than once the connection is already open.

I have to admit it does feel a bit strange to use HTTP error codes in WebSocket messages, but I personally like the re-use of the Problem Details Format.

Let me know what you think.

P.S. There was also talk in #67 of trying to align message types with the Scripting API, though I'm not sure that scripting errors and protocol errors always have a direct correlation.


Preview | Diff

Copy link
Collaborator

@hspaay hspaay left a comment

Choose a reason for hiding this comment

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

I support the idea of using RFC9457 as it is a well thought out and widely adopted way to identify errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Specify error message format
2 participants