Browse Source

Avoid swallowing errors on example model instantiation (#964)

Brian Ferri 2 months ago
parent
commit
e30ce8b333
2 changed files with 2 additions and 6 deletions
  1. 1 1
      src/Extracting/InstantiatesExampleModels.php
  2. 1 5
      src/Tools/ErrorHandlingUtils.php

+ 1 - 1
src/Extracting/InstantiatesExampleModels.php

@@ -55,7 +55,7 @@ trait InstantiatesExampleModels
                 if ($model) return $model;
             } catch (Throwable $e) {
                 c::warn("Couldn't get example model for {$type} via $strategyName.");
-                e::dumpExceptionIfVerbose($e, true);
+                e::dumpExceptionIfVerbose($e);
             }
         }
 

+ 1 - 5
src/Tools/ErrorHandlingUtils.php

@@ -7,12 +7,8 @@ use Symfony\Component\Console\Output\OutputInterface;
 
 class ErrorHandlingUtils
 {
-    public static function dumpExceptionIfVerbose(\Throwable $e, $completelySilent = false): void
+    public static function dumpExceptionIfVerbose(\Throwable $e): void
     {
-        if ($completelySilent) {
-            return;
-        }
-
         if (Globals::$shouldBeVerbose) {
             self::dumpException($e);
             return;