Catch error.

This commit is contained in:
James Cole
2021-07-26 18:51:29 +02:00
parent 0d4e952a69
commit 89f98bb7ab

View File

@@ -26,6 +26,7 @@ namespace FireflyIII\Rules;
use Carbon\Carbon;
use Carbon\Exceptions\InvalidDateException;
use Carbon\Exceptions\InvalidFormatException;
use Illuminate\Contracts\Validation\Rule;
use Log;
@@ -67,6 +68,10 @@ class IsDateOrTime implements Rule
} catch (InvalidDateException $e) {
Log::error(sprintf('"%s" is not a valid date: %s', $value, $e->getMessage()));
return false;
} catch(InvalidFormatException $e) {
Log::error(sprintf('"%s" is of an invalid format: %s', $value, $e->getMessage()));
return false;
}
@@ -78,6 +83,10 @@ class IsDateOrTime implements Rule
} catch (InvalidDateException $e) {
Log::error(sprintf('"%s" is not a valid date or time: %s', $value, $e->getMessage()));
return false;
} catch(InvalidFormatException $e) {
Log::error(sprintf('"%s" is of an invalid format: %s', $value, $e->getMessage()));
return false;
}