Skip to content

Commit 854d69a

Browse files
committed
remove try/catch block
1 parent dab59cc commit 854d69a

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

app/Helper/MWTimestampHelper.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ class MWTimestampHelper {
1515
private const MWTimestampFormat = 'YmdHis';
1616

1717
public static function getCarbonFromMWTimestamp(string $MWTimestamp): CarbonImmutable {
18-
try {
19-
$carbon = CarbonImmutable::createFromFormat(self::MWTimestampFormat, $MWTimestamp);
20-
} catch (InvalidFormatException $exception) {
21-
throw new InvalidFormatException('Unable to create Carbon object: invalid MW timestamp format', 0, $exception);
22-
}
18+
$carbon = CarbonImmutable::createFromFormat(self::MWTimestampFormat, $MWTimestamp);
2319

2420
if (!$carbon instanceof CarbonImmutable) {
2521
throw new InvalidFormatException('Unable to create Carbon object: parser did not return CarbonImmutable');

0 commit comments

Comments
 (0)