dryRun ? ['--dry-run' => true] : []); $output = Artisan::output(); } catch (Throwable $e) { // A throw is an outcome too, and it has to reach the page. Left // uncaught this would be a failed job in a table nobody on this // page can see, under a "sync running" note that never resolves. $status->record( ok: false, dryRun: $this->dryRun, output: $e->getMessage(), by: $this->by, ); return; } $status->record( ok: $exit === 0, dryRun: $this->dryRun, // Whole and unedited — see CatalogueSyncStatus. The command's own // refusals are instructions, not statuses. output: trim($output), by: $this->by, ); } }