fix: prevent hard 500 on paypal sync failure path
This commit is contained in:
@@ -336,12 +336,17 @@ class AdminDashboardController extends Controller
|
|||||||
$resultSandbox = $sync->sync('sandbox');
|
$resultSandbox = $sync->sync('sandbox');
|
||||||
$resultLive = $sync->sync('live');
|
$resultLive = $sync->sync('live');
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
report($e);
|
try {
|
||||||
$this->logAdminAction('paypal_plan_sync_failed', [
|
$this->logAdminAction('paypal_plan_sync_failed', [
|
||||||
'error' => $e->getMessage(),
|
'error' => $e->getMessage(),
|
||||||
]);
|
]);
|
||||||
|
} catch (\Throwable) {
|
||||||
|
// swallow secondary failures so sync endpoint never hard-crashes
|
||||||
|
}
|
||||||
|
|
||||||
return back()->withErrors([
|
return redirect()
|
||||||
|
->route('dashboard.admin.pricing')
|
||||||
|
->withErrors([
|
||||||
'pricing' => 'PayPal sync failed. Check server logs for details (network/credentials/proxy).',
|
'pricing' => 'PayPal sync failed. Check server logs for details (network/credentials/proxy).',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user