1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 14:12:44 +01:00

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();
}
} catch(\Exception $e) {
// nlog($e->getMessage());
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..