Skip to content

Commit

Permalink
Add docs for the error URI resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
mbabker committed Dec 13, 2023
1 parent f05d1c9 commit c344b30
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/error-uri-resolver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Error URI Resolver

Per the [WAMP v1](https://web.archive.org/web/20150419051041/http://wamp.ws/spec/wamp1/) specification, a "CALLERROR" message must include an error URI describing the error in its payload. The `BabDev\WebSocket\Server\WAMP\ErrorUriResolver` interface describes a service that can be used to accomplish this.

The specification, however, does not specify any error identifiers that must be supported. Therefore, it is up to the application to decide whether they will use this resolver in their [message handlers](/open-source/packages/websocket-server/docs/1.x/message-handler) or [message middleware](/open-source/packages/websocket-server/docs/1.x/middleware) when handling RPC messages. Because this library emits "CALLERROR" messages if the [`BabDev\WebSocket\Server\WAMP\Middleware\DispatchMessageToHandler`](/open-source/packages/websocket-server/docs/1.x/middleware/dispatch-message-to-handler) middleware cannot locate a message handler for the given request, the error URI resolver is provided in part to allow applications to customize the URI used for these errors. The default `BabDev\WebSocket\Server\WAMP\DefaultErrorUriResolver` implementation only supports the `not-found` error type and will return a generic URI for all other error types.
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
- [Installation & Setup](/open-source/packages/websocket-server/docs/1.x/installation)
- [Architecture](/open-source/packages/websocket-server/docs/1.x/architecture)
- [Connection](/open-source/packages/websocket-server/docs/1.x/connection)
- [Error URI Resolver](/open-source/packages/websocket-server/docs/1.x/error-uri-resolver)
- [Message Handler](/open-source/packages/websocket-server/docs/1.x/message-handler)
- [Message Handler Resolver](/open-source/packages/websocket-server/docs/1.x/message-handler-resolver)
- [Middleware](/open-source/packages/websocket-server/docs/1.x/middleware)
Expand Down

0 comments on commit c344b30

Please sign in to comment.