Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Entities/Properties/LastEditedTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use DateTime;
use Exception;
use FiveamCode\LaravelNotionApi\Exceptions\HandlingException;
use Throwable;

/**
* Class LastEditedTime
Expand All @@ -20,10 +21,10 @@ protected function fillFromRaw(): void
parent::fillFromRaw();

try {
if ($this->rawContent !== null) {
if (is_string($this->rawContent) && $this->rawContent !== null) {
$this->content = new DateTime($this->rawContent);
}
} catch (Exception $e) {
} catch (Throwable $e) {
throw HandlingException::instance('The content of last_edited_time is not a valid ISO 8601 date time string.');
}
}
Expand Down