Skip to content
Snippets Groups Projects
Commit 9ba259be authored by Alex Pott's avatar Alex Pott
Browse files

Issue #1788610 by chertzog, fjd, brainbender: Hook_update_N has unreachable UpdateException.

parent 28077fa5
No related branches found
No related tags found
No related merge requests found
......@@ -2584,12 +2584,14 @@ function hook_update_N(&$sandbox) {
$sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['progress'] / $sandbox['max']);
if ($some_error_condition_met) {
// In case of an error, simply throw an exception with an error message.
throw new UpdateException('Something went wrong; here is what you should do.');
}
// To display a message to the user when the update is completed, return it.
// If you do not want to display a completion message, simply return nothing.
return t('The update did what it was supposed to do.');
// In case of an error, simply throw an exception with an error message.
throw new UpdateException('Something went wrong; here is what you should do.');
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment