That's not the right code to send to the clients. It's the code the server itself receives from the API. So we have some server error, wich is a 5er error code. Maybe a 502 (bad gateway) is more apropriate. And we should probably not expose the full message, as it could contain private data.

```php
throw new \CHttpException(502, "Bad gateway");
Yii::log("Received a $config[code] while trying to fetch resource $name: $config[message]", 'restyii.client.schema');
```

But we should ask @phpnode if this is the right place to deal with this.