From 6bf955ca9ea531c699aff3eac403e3c993163dbc Mon Sep 17 00:00:00 2001 From: Cameron Ball Date: Thu, 12 Jan 2023 16:31:46 +0800 Subject: [PATCH] MDL-76869 gradebook: Pass exception to rollback --- grade/classes/external/create_gradecategories.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grade/classes/external/create_gradecategories.php b/grade/classes/external/create_gradecategories.php index 924bf4d9eca..2f6ab0e045c 100644 --- a/grade/classes/external/create_gradecategories.php +++ b/grade/classes/external/create_gradecategories.php @@ -231,7 +231,7 @@ class create_gradecategories extends external_api { } catch (\Exception $e) { // If the submitted data was broken for any reason. $warnings['database'] = $e->getMessage(); - $transaction->rollback(); + $transaction->rollback($e); return ['warnings' => $warnings]; } }