Skip to content

Commit

Permalink
feature: add a log message error
Browse files Browse the repository at this point in the history
  • Loading branch information
glaubersilva committed Jan 23, 2025
1 parent 285b9c7 commit f1b918f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Framework/Support/Facades/DateTime/TemporalFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use DateTimeInterface;
use DateTimeZone;
use Exception;
use Give\Log\Log;

/**
* @since 2.19.6
Expand Down Expand Up @@ -91,6 +92,15 @@ public function getDateTimestamp(string $date, string $timezone = ''): int

return $date->getTimestamp();
} catch (Exception $e) {
Log::error(
'Failed to parse date string into a timestamp',
[
'input_date' => $date,
'input_timezone' => $timezone,
'error_code' => $e->getCode(),
'error_message' => $e->getMessage(),
]
);
return 0;
}
}
Expand Down

0 comments on commit f1b918f

Please sign in to comment.