Skip to content

Commit

Permalink
chore: add task name to replace exception message (#3184)
Browse files Browse the repository at this point in the history
To clarify which task is causing the exception.
  • Loading branch information
kjkooistra-youwe authored Jul 4, 2022
1 parent 8e4366b commit c365661
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function task(string $name, $body = null): Task
$existingTask = $deployer->tasks->get($name);
if (get_class($existingTask) !== get_class($task)) {
// There is no "up" or "down"casting in PHP.
throw new \Exception('Tried to replace a Task with a GroupTask or vice-versa. This is not supported. If you are sure you want to do that, remove the old task `Deployer::get()->tasks->remove(<taskname>)` and then re-add the task.');
throw new \Exception('Tried to replace Task \'' . $name . '\' with a GroupTask or vice-versa. This is not supported. If you are sure you want to do that, remove the old task `Deployer::get()->tasks->remove(<taskname>)` and then re-add the task.');
}
if ($existingTask instanceof GroupTask) {
$existingTask->setGroup($body);
Expand Down

0 comments on commit c365661

Please sign in to comment.