You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -171,13 +171,14 @@ public function symlink($originDir, $targetDir, $copyOnWindows = false)
171
171
}
172
172
173
173
if (!$ok) {
174
-
try {
175
-
symlink($originDir, $targetDir);
176
-
} catch (\ErrorException$e) {
177
-
if (defined('PHP_WINDOWS_VERSION_MAJOR') && false !== strpos($e->getMessage(), 'error code(1314)')) {
178
-
thrownew \RuntimeException("Unable to create symlink due to error code 1314: A required privilege is not held by the client. Do you have the required Administrator-rights?");
174
+
if (false === @symlink($originDir, $targetDir)) {
175
+
$report = error_get_last();
176
+
if (is_array($report) && $report['type'] & error_reporting()) {
177
+
if (defined('PHP_WINDOWS_VERSION_MAJOR') && false !== strpos($report['message'], 'error code(1314)')) {
178
+
thrownew \RuntimeException('Unable to create symlink due to error code 1314: \'A required privilege is not held by the client\'. Do you have the required Administrator-rights?');
179
+
}
180
+
thrownew \RuntimeException(sprintf("%s in %s line %s", $report['message'], $report['file'], $report['line']));
0 commit comments