---
title: "Error URI Resolver"
package: "WebSocket Server"
version: "1.x"
canonical_url: "https://www.babdev.com/open-source/packages/websocket-server/docs/1.x/error-uri-resolver"
package_supported: true
version_released: false
notice:
  - "Version 1.x of WebSocket Server has not been released yet. Its API may change before release."
---
# 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 middleware uses the following error types:

- `not-found` - no message handler could be found for the procedure URI
- `internal-error` - the message handler failed to process the call (for example, it threw an exception)

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, including `internal-error`.
