Преглед изворни кода

fix(apiResource/warn when creation failed)[ISSUE-412]: added warn message and exception dumps, when creating (storing) failed

pallam пре 3 година
родитељ
комит
23fe3f7130
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      src/Extracting/Strategies/Responses/UseApiResourceTags.php

+ 3 - 0
src/Extracting/Strategies/Responses/UseApiResourceTags.php

@@ -205,6 +205,9 @@ class UseApiResourceTags extends Strategy
             try {
                 return $factory->create();
             } catch (Throwable $e) {
+                c::warn("Eloquent model factory failed to create {$type}; trying to make it.");
+                e::dumpExceptionIfVerbose($e, true);
+
                 // If there was no working database, ->create() would fail. Try ->make() instead
                 return $factory->make();
             }