Skip to content

Commit

Permalink
Fix DateTimePacker not catching invalid date/times
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Jul 16, 2019
1 parent d3aaf62 commit d621864
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ObjectPacker/DateTimePacker.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

namespace Brick\App\ObjectPacker;

use Brick\DateTime\DateTimeException;
use Brick\DateTime\Duration;
use Brick\DateTime\LocalDate;
use Brick\DateTime\LocalDateTime;
use Brick\DateTime\LocalTime;
use Brick\DateTime\Parser\DateTimeParseException;
use Brick\DateTime\TimeZoneOffset;
use Brick\DateTime\TimeZoneRegion;
use Brick\DateTime\YearMonth;
Expand Down Expand Up @@ -93,7 +93,7 @@ public function unpack(PackedObject $packedObject)
case ZonedDateTime::class:
return ZonedDateTime::parse($data);
}
} catch (DateTimeParseException $e) {
} catch (DateTimeException $e) {
throw new Exception\ObjectNotConvertibleException($e->getMessage(), 0, $e);
}

Expand Down

0 comments on commit d621864

Please sign in to comment.