protected function handleErrorResponse($code)
{
switch ($code) {
case '403':
$msg = 'The requested project does not support SSL - resubmit in an http request.';
break;
case '422':
$msg = 'The submitted notice was invalid - check the notice xml against the schema.';
break;
case '500':
$msg = 'Unexpected errors - submit a bug report at http://help.hoptoadapp.com.';
break;
default:
$msg = 'Unknown error code from Hoptoad\'s API: ' . $code;
break;
}
throw new RuntimeException($msg, $code);
}