mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-30 10:47:06 -06:00
Log errors instead of giving exceptions
This commit is contained in:
parent
d96e77a3ec
commit
713a962005
@ -25,6 +25,7 @@ namespace FireflyIII\Support;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Helpers\Fiscal\FiscalHelperInterface;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class Navigation.
|
||||
@ -37,8 +38,6 @@ class Navigation
|
||||
* @param $skip
|
||||
*
|
||||
* @return \Carbon\Carbon
|
||||
*
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function addPeriod(Carbon $theDate, string $repeatFreq, int $skip): Carbon
|
||||
{
|
||||
@ -73,7 +72,9 @@ class Navigation
|
||||
];
|
||||
|
||||
if (!isset($functionMap[$repeatFreq])) {
|
||||
throw new FireflyException(sprintf('Cannot do addPeriod for $repeat_freq "%s"', $repeatFreq));
|
||||
Log::error(sprintf('Cannot do addPeriod for $repeat_freq "%s"', $repeatFreq));
|
||||
|
||||
return $theDate;
|
||||
}
|
||||
if (isset($modifierMap[$repeatFreq])) {
|
||||
$add *= $modifierMap[$repeatFreq];
|
||||
@ -169,8 +170,6 @@ class Navigation
|
||||
* @param $repeatFreq
|
||||
*
|
||||
* @return \Carbon\Carbon
|
||||
*
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function endOfPeriod(\Carbon\Carbon $end, string $repeatFreq): Carbon
|
||||
{
|
||||
@ -220,7 +219,9 @@ class Navigation
|
||||
|
||||
|
||||
if (!isset($functionMap[$repeatFreq])) {
|
||||
throw new FireflyException(sprintf('Cannot do endOfPeriod for $repeat_freq "%s"', $repeatFreq));
|
||||
Log::error(sprintf('Cannot do endOfPeriod for $repeat_freq "%s"', $repeatFreq));
|
||||
|
||||
return $end;
|
||||
}
|
||||
$function = $functionMap[$repeatFreq];
|
||||
|
||||
@ -323,8 +324,6 @@ class Navigation
|
||||
* @param string $repeatFrequency
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function periodShow(\Carbon\Carbon $theDate, string $repeatFrequency): string
|
||||
{
|
||||
@ -355,7 +354,10 @@ class Navigation
|
||||
}
|
||||
|
||||
// special formatter for quarter of year
|
||||
throw new FireflyException(sprintf('No date formats for frequency "%s"!', $repeatFrequency));
|
||||
Log::error(sprintf('No date formats for frequency "%s"!', $repeatFrequency));
|
||||
|
||||
return $date->format('Y-m-d');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -478,8 +480,6 @@ class Navigation
|
||||
* @param $repeatFreq
|
||||
*
|
||||
* @return \Carbon\Carbon
|
||||
*
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function startOfPeriod(Carbon $theDate, string $repeatFreq): Carbon
|
||||
{
|
||||
@ -520,8 +520,10 @@ class Navigation
|
||||
if ('custom' === $repeatFreq) {
|
||||
return $date; // the date is already at the start.
|
||||
}
|
||||
Log::error(sprintf('Cannot do startOfPeriod for $repeat_freq "%s"', $repeatFreq));
|
||||
|
||||
return $theDate;
|
||||
|
||||
throw new FireflyException(sprintf('Cannot do startOfPeriod for $repeat_freq "%s"', $repeatFreq));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user