@bakura10 nah, simply a map from exception type to response code would be ok (IMO)

No need for having people implement any interface.

It would probably look like following:

```php
public function buildApiProblem(\Exception $exception)
{
    $type = get_class($exception); // further improvements possible here
    $code = 500;

    if (isset($this->mappedResponseCodes[$type])) {
        $code = $this->mappedResponseCodes[$type];
    }

    return new ApiProblem($code, $exception->getMessage(), /* other stuff to be passed to it */);
}
```