mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-10-31 02:36:28 +00:00 
			
		
		
		
	Catch error.
This commit is contained in:
		| @@ -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; | ||||
|         } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user