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]; } }