refactor exceptions

This commit is contained in:
DavidBadura
2015-04-06 21:13:02 +00:00
parent ec8ab39e7c
commit 0ab45fae1f
11 changed files with 189 additions and 88 deletions

View File

@@ -2,13 +2,14 @@
namespace DavidBadura\Taskwarrior;
use Carbon\Carbon;
use DavidBadura\Taskwarrior\Exception\TaskwarriorException;
use DavidBadura\Taskwarrior\Serializer\Handler\CarbonHandler;
use DavidBadura\Taskwarrior\Serializer\Handler\RecurringHandler;
use JMS\Serializer\Handler\HandlerRegistryInterface;
use JMS\Serializer\JsonSerializationVisitor;
use JMS\Serializer\Naming\CamelCaseNamingStrategy;
use JMS\Serializer\Naming\SerializedNameAnnotationStrategy;
use JMS\Serializer\SerializationContext;
use JMS\Serializer\Serializer;
use JMS\Serializer\SerializerBuilder;
@@ -133,8 +134,13 @@ class TaskManager
return;
}
$this->taskwarrior->delete($task->getUuid());
$this->refresh($task);
if ($task->isRecurring()) {
$task->setUntil('now');
$this->save($task);
} else {
$this->taskwarrior->delete($task->getUuid());
$this->refresh($task);
}
}
/**