diff --git a/docs/error-uri-resolver.md b/docs/error-uri-resolver.md new file mode 100644 index 0000000..aa1b039 --- /dev/null +++ b/docs/error-uri-resolver.md @@ -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. diff --git a/docs/index.md b/docs/index.md index 227f526..b5bb5ed 100644 --- a/docs/index.md +++ b/docs/index.md @@ -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)