catches for live previews

This commit is contained in:
David Bomba 2023-10-11 20:01:28 +11:00
parent 00d535a8b4
commit 8210bce2bc

View File

@ -290,10 +290,14 @@ class PreviewController extends BaseController
return $maker->getCompiledHTML(); return $maker->getCompiledHTML();
} }
} catch(\Exception $e) { } catch(\Exception $e) {
// nlog($e->getMessage());
DB::connection(config('database.default'))->rollBack(); DB::connection(config('database.default'))->rollBack();
return; if (DB::connection(config('database.default'))->transactionLevel() > 0) {
DB::connection(config('database.default'))->rollBack();
}
return response()->json(['message' => 'Error generating preview. Please retry again shortly.'], 400);
} }
//if phantom js...... inject here.. //if phantom js...... inject here..