Skip to content

Commit f1720e1

Browse files
mfnd3v2a
authored andcommitted
Catch error and exception (barryvdh#1431) (barryvdh#1465)
Credit goes to @dongm2ez
1 parent 0f08f53 commit f1720e1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Alias.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
2121
use Illuminate\Support\Facades\Facade;
2222
use ReflectionClass;
23+
use Throwable;
2324

2425
class Alias
2526
{
@@ -301,7 +302,7 @@ protected function detectRoot()
301302
"\nPlease configure your database connection correctly, or use the sqlite memory driver (-M)." .
302303
" Skipping $facade."
303304
);
304-
} catch (\Exception $e) {
305+
} catch (Throwable $e) {
305306
$this->error('Exception: ' . $e->getMessage() . "\nSkipping $facade.");
306307
}
307308
}
@@ -323,7 +324,7 @@ protected function isTrait()
323324
protected function addMagicMethods()
324325
{
325326
foreach ($this->magicMethods as $magic => $real) {
326-
list($className, $name) = explode('::', $real);
327+
[$className, $name] = explode('::', $real);
327328
if ((!class_exists($className) && !interface_exists($className)) || !method_exists($className, $name)) {
328329
continue;
329330
}

0 commit comments

Comments
 (0)