Skip to content
This repository was archived by the owner on Jun 26, 2019. It is now read-only.

Commit

Permalink
Remove some stray drush_set_error()
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman committed Dec 29, 2016
1 parent 54e7c0f commit 26d2c0f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/Drush/Commands/core/BrowseCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function browse($path = '', $options = ['browser' => NULL]) {
$site_record = drush_sitealias_get_record($alias);
$return = drush_invoke_process($site_record, 'browse', [$path], drush_redispatch_get_options(), array('integrate' => TRUE));
if ($return['error_status']) {
return drush_set_error('Unable to execute browse command on remote alias.');
throw new \Exception('Unable to execute browse command on remote alias.');
}
else {
$link = $return['object'];
Expand Down
3 changes: 2 additions & 1 deletion lib/Drush/Commands/core/NotifyCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use Consolidation\AnnotatedCommand\CommandData;
use Drush\Commands\DrushCommands;
use Drush\Log\LogLevel;
use Symfony\Component\Config\Definition\Exception\Exception;

/**
* @todo there are no hooks fired after a command errors out. Still?
Expand Down Expand Up @@ -146,7 +147,7 @@ static function shutdownSendAudio($msg, CommandData $commandData) {
}

if (!drush_shell_exec($cmd, $msg)) {
return drush_set_error('NOTIFY_COMMAND_NOT_FOUND', dt('The third party notification utility failed.'));
throw new Exception('The third party notification utility failed.');
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Drush/Commands/core/SqlCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function query($query = '', $options = ['result-file' => NULL, 'file' =>
$sql = drush_sql_get_class($options['db-spec']);
$result = $sql->query($query, $filename, $options['result-file']);
if (!$result) {
return drush_set_error('DRUSH_SQL_NO_QUERY', dt('Query failed.'));
throw new \Exception(dt('Query failed.'));
}
drush_print(implode("\n", drush_shell_exec_output()));
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Drush/Commands/core/WatchdogCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function delete($substring = '', $options = ['severity' => NULL, 'type' =
else {

if ((!isset($substring))&&(!isset($options['type']))&&(!isset($options['severity']))) {
return drush_set_error(dt('No options provided.'));
throw new \Exception(dt('No options provided.'));
}
$where = $this->where($options['type'], $options['severity'], $substring, 'OR');
drush_print(dt('All messages with !where will be deleted.', array('!where' => preg_replace("/message LIKE %$substring%/", "message body containing '$substring'" , strtr($where['where'], $where['args'])))));
Expand Down

0 comments on commit 26d2c0f

Please sign in to comment.