MDL-38525: Assignment - print exception message when assignment upgrade fails.
authorRyan Panning <Ryan.Panning@district196.org>
Wed, 10 Apr 2013 06:38:05 +0000 (14:38 +0800)
committerDamyon Wiese <damyon@moodle.com>
Wed, 10 Apr 2013 08:18:31 +0000 (16:18 +0800)
Change to use getMessage() from the Exception class will prevent "{$a}" when
$e->error is null.

mod/assign/upgradelib.php

index 89f15a2..4ddb9e7 100644 (file)
@@ -257,7 +257,7 @@ class assign_upgrade_manager {
 
         } catch (Exception $exception) {
             $rollback = true;
-            $log .= get_string('conversionexception', 'mod_assign', $exception->error);
+            $log .= get_string('conversionexception', 'mod_assign', $exception->getMessage());
         }
 
         if ($rollback) {