]> git.localhorst.tv Git - alttp.git/commitdiff
log aosr seed generation errors
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 10 May 2022 17:34:55 +0000 (19:34 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 10 May 2022 17:34:55 +0000 (19:34 +0200)
app/Jobs/GenerateAosSeed.php
app/Models/AosSeed.php
database/migrations/2022_05_10_172556_log_aosr_error.php [new file with mode: 0644]

index b8c7e9e73c9d4343e4104daea3ff2ee9319f83bf..7169c3610f90f4714796329d809fb25bf65e05e1 100644 (file)
@@ -69,8 +69,12 @@ class GenerateAosSeed implements ShouldQueue
                        $seed->save();
 
                        $browser->close();
-               } catch (\Throwable) {
+               } catch (\Throwable $e) {
                        $seed->status = 'error';
+                       $seed->error_detail = [
+                               'type' => get_class($e),
+                               'message' => $e->getMessage(),
+                       ];
                        $seed->save();
                }
        }
index 18633b7a471ce65a0be0d1e02f28bea0d20e4629..b0b1ee743669f76ca722091ab56eeeca99b47921 100644 (file)
@@ -31,6 +31,7 @@ class AosSeed extends Model
        }
 
        protected $casts = [
+               'error_detail' => 'array',
                'mystery' => 'boolean',
                'race' => 'boolean',
                'settings' => 'array',
diff --git a/database/migrations/2022_05_10_172556_log_aosr_error.php b/database/migrations/2022_05_10_172556_log_aosr_error.php
new file mode 100644 (file)
index 0000000..8a8b0d5
--- /dev/null
@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+               Schema::table('aos_seeds', function(Blueprint $table) {
+                       $table->text('error_detail')->nullable()->default(null);
+               });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+               Schema::table('aos_seeds', function(Blueprint $table) {
+                       $table->dropColumn('error_detail');
+               });
+    }
+};