Closed (fixed)
Project:
Provision
Version:
6.x-1.3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Aug 2011 at 17:39 UTC
Updated:
12 Jun 2014 at 08:41 UTC
Jump to comment: Most recent
While developing a new service for Provision, I ran across the following error message:
Drush command terminated abnormally due to an unrecoverable error. [error] Error: Can only throw objects in /opt/aegir/.drush/provision/provision.config.inc, line 75
The offending code is:
function __construct($context, $data = array()) {
if (is_null($this->template)) {
throw(exception); // Line 75
}
...
I'm guessing this is supposed to be something like:
function __construct($context, $data = array()) {
if (is_null($this->template)) {
drush_set_error('PROVISION_INTERNAL_ERROR', dt("No template specified: %class", array('%class' => get_class($this))));
return;
}
...
Assuming this is the correct way to handle this issue, attached is a patch to corrects this oversight.
| Comment | File | Size | Author |
|---|---|---|---|
| provision_config_template_exception_fix.patch | 479 bytes | guypaddock |
Comments
Comment #1
guypaddock commentedSetting to needs review.
Comment #2
steven jones commentedYup, this just isn't how you throw an exception is it! I've fixed that so we actually throw it properly, using your helpful message. Thanks for the bug report though!