reduce code duplication for error handling

This commit is contained in:
Robin Appelman 2016-08-26 23:18:04 +02:00
commit 471824d423
3 changed files with 12 additions and 11 deletions

View file

@ -59,11 +59,7 @@ class NativeState {
case 113:
throw new NoRouteToHostException($path, $error);
default:
$message = 'Unknown error (' . $error . ')';
if ($path) {
$message .= ' for ' . $path;
}
throw new Exception($message, $error);
throw Exception::unknown($path, $error);
}
}