From: Daniel Karbach Date: Tue, 10 May 2022 17:34:55 +0000 (+0200) Subject: log aosr seed generation errors X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=37ae4fea9558f58e9109e7d7127ee137474bfba4;p=alttp.git log aosr seed generation errors --- diff --git a/app/Jobs/GenerateAosSeed.php b/app/Jobs/GenerateAosSeed.php index b8c7e9e..7169c36 100644 --- a/app/Jobs/GenerateAosSeed.php +++ b/app/Jobs/GenerateAosSeed.php @@ -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(); } } diff --git a/app/Models/AosSeed.php b/app/Models/AosSeed.php index 18633b7..b0b1ee7 100644 --- a/app/Models/AosSeed.php +++ b/app/Models/AosSeed.php @@ -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 index 0000000..8a8b0d5 --- /dev/null +++ b/database/migrations/2022_05_10_172556_log_aosr_error.php @@ -0,0 +1,32 @@ +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'); + }); + } +};