Skip to content

Commit

Permalink
Show database table validation errors in ApplicationException modal
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Thomson committed Jun 12, 2019
1 parent 0d2c20b commit fcb1e05
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions behaviors/IndexDatabaseTableOperations.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ public function onDatabaseTableValidateAndShowPopup()

$pluginCode = Request::input('plugin_code');
$model->setPluginCode($pluginCode);
$model->validate();
try {
$model->validate();
} catch (Exception $ex) {
throw new ApplicationException($ex->getMessage());
}

$migration = $model->generateCreateOrUpdateMigration();

Expand Down Expand Up @@ -91,7 +95,7 @@ public function onDatabaseTableMigrationApply()

try {
$model->save();
}
}
catch (Exception $ex) {
throw new ApplicationException($ex->getMessage());
}
Expand Down Expand Up @@ -203,4 +207,4 @@ protected function processColumnData($postData)

return $postData;
}
}
}

0 comments on commit fcb1e05

Please sign in to comment.