mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Remove static references
This commit is contained in:
parent
e65d0eef6e
commit
075d459b7c
@ -100,9 +100,9 @@ abstract class Controller extends BaseController
|
||||
try {
|
||||
$date = request()->query->get($field);
|
||||
} catch (BadRequestException $e) {
|
||||
Log::error(sprintf('Request field "%s" contains a non-scalar value. Value set to NULL.', $field));
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Request field "%s" contains a non-scalar value. Value set to NULL.', $field));
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$value = null;
|
||||
}
|
||||
$obj = null;
|
||||
@ -129,9 +129,9 @@ abstract class Controller extends BaseController
|
||||
try {
|
||||
$value = request()->query->get($integer);
|
||||
} catch (BadRequestException $e) {
|
||||
Log::error(sprintf('Request field "%s" contains a non-scalar value. Value set to NULL.', $integer));
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Request field "%s" contains a non-scalar value. Value set to NULL.', $integer));
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$value = null;
|
||||
}
|
||||
if (null !== $value) {
|
||||
@ -159,9 +159,9 @@ abstract class Controller extends BaseController
|
||||
try {
|
||||
$param = (string)request()->query->get('sort');
|
||||
} catch (BadRequestException $e) {
|
||||
Log::error('Request field "sort" contains a non-scalar value. Value set to NULL.');
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error('Request field "sort" contains a non-scalar value. Value set to NULL.');
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$param = '';
|
||||
}
|
||||
if ('' === $param) {
|
||||
|
@ -107,7 +107,7 @@ class StoreController extends Controller
|
||||
$helper = app(AttachmentHelperInterface::class);
|
||||
$body = $request->getContent();
|
||||
if ('' === $body) {
|
||||
Log::error('Body of attachment is empty.');
|
||||
app('log')->error('Body of attachment is empty.');
|
||||
|
||||
return response()->json([], 422);
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ class StoreController extends Controller
|
||||
throw new ValidationException($validator, 0, $e);
|
||||
} catch (FireflyException $e) {
|
||||
app('log')->warning('Caught an exception. Return error message.');
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
$message = sprintf('Internal exception: %s', $e->getMessage());
|
||||
$validator = Validator::make(['transactions' => [['description' => $message]]], ['transactions.0.description' => new IsDuplicateTransaction()]);
|
||||
throw new ValidationException($validator, 0, $e);
|
||||
|
@ -70,8 +70,8 @@ class ConfigurationController extends Controller
|
||||
try {
|
||||
$dynamicData = $this->getDynamicConfiguration();
|
||||
} catch (FireflyException $e) {
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
throw new FireflyException('200030: Could not load config variables.', 0, $e);
|
||||
}
|
||||
$staticData = $this->getStaticConfiguration();
|
||||
|
@ -55,7 +55,7 @@ class TransactionRequest extends FormRequest
|
||||
];
|
||||
} catch (JsonException $e) {
|
||||
// dont really care. the validation should catch invalid json.
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
}
|
||||
|
||||
return $data;
|
||||
|
@ -103,9 +103,9 @@ class Controller extends BaseController
|
||||
try {
|
||||
$date = request()->query->get($field);
|
||||
} catch (BadRequestException $e) {
|
||||
Log::error(sprintf('Request field "%s" contains a non-scalar value. Value set to NULL.', $field));
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Request field "%s" contains a non-scalar value. Value set to NULL.', $field));
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
}
|
||||
if (null !== $date) {
|
||||
try {
|
||||
@ -128,8 +128,8 @@ class Controller extends BaseController
|
||||
try {
|
||||
$value = request()->query->get($integer);
|
||||
} catch (BadRequestException $e) {
|
||||
Log::error(sprintf('Request field "%s" contains a non-scalar value. Value set to NULL.', $integer));
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error(sprintf('Request field "%s" contains a non-scalar value. Value set to NULL.', $integer));
|
||||
app('log')->error($e->getMessage());
|
||||
$value = null;
|
||||
}
|
||||
if (null !== $value) {
|
||||
|
@ -82,7 +82,7 @@ class DeleteEmptyJournals extends Command
|
||||
TransactionJournal::find((int)$row->transaction_journal_id)->delete();
|
||||
} catch (QueryException $e) {
|
||||
app('log')->info(sprintf('Could not delete journal: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
}
|
||||
|
||||
|
||||
@ -114,7 +114,7 @@ class DeleteEmptyJournals extends Command
|
||||
TransactionJournal::find($entry->id)->delete();
|
||||
} catch (QueryException $e) {
|
||||
app('log')->info(sprintf('Could not delete entry: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
}
|
||||
|
||||
|
||||
|
@ -203,7 +203,7 @@ class ExportData extends Command
|
||||
try {
|
||||
$date = Carbon::createFromFormat('!Y-m-d', $this->option($field));
|
||||
} catch (InvalidArgumentException $e) {
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
$this->friendlyError(sprintf('%s date "%s" must be formatted YYYY-MM-DD. Field will be ignored.', $field, $this->option('start')));
|
||||
$error = true;
|
||||
}
|
||||
|
@ -66,13 +66,13 @@ class ScanAttachments extends Command
|
||||
$fileName = $attachment->fileName();
|
||||
$encryptedContent = $disk->get($fileName);
|
||||
if (null === $encryptedContent) {
|
||||
Log::error(sprintf('No content for attachment #%d under filename "%s"', $attachment->id, $fileName));
|
||||
app('log')->error(sprintf('No content for attachment #%d under filename "%s"', $attachment->id, $fileName));
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
$decryptedContent = Crypt::decrypt($encryptedContent); // verified
|
||||
} catch (DecryptException $e) {
|
||||
Log::error(sprintf('Could not decrypt data of attachment #%d: %s', $attachment->id, $e->getMessage()));
|
||||
app('log')->error(sprintf('Could not decrypt data of attachment #%d: %s', $attachment->id, $e->getMessage()));
|
||||
$decryptedContent = $encryptedContent;
|
||||
}
|
||||
$tempFileName = tempnam(sys_get_temp_dir(), 'FireflyIII');
|
||||
|
@ -84,8 +84,8 @@ class Cron extends Command
|
||||
try {
|
||||
$this->exchangeRatesCronJob($force, $date);
|
||||
} catch (FireflyException $e) {
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$this->friendlyError($e->getMessage());
|
||||
}
|
||||
}
|
||||
@ -96,8 +96,8 @@ class Cron extends Command
|
||||
try {
|
||||
$this->recurringCronJob($force, $date);
|
||||
} catch (FireflyException $e) {
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$this->friendlyError($e->getMessage());
|
||||
}
|
||||
|
||||
@ -107,8 +107,8 @@ class Cron extends Command
|
||||
try {
|
||||
$this->autoBudgetCronJob($force, $date);
|
||||
} catch (FireflyException $e) {
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$this->friendlyError($e->getMessage());
|
||||
}
|
||||
|
||||
@ -118,8 +118,8 @@ class Cron extends Command
|
||||
try {
|
||||
$this->billWarningCronJob($force, $date);
|
||||
} catch (FireflyException $e) {
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$this->friendlyError($e->getMessage());
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ class DecryptDatabase extends Command
|
||||
try {
|
||||
$configVar = app('fireflyconfig')->get($configName, false);
|
||||
} catch (FireflyException $e) {
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
}
|
||||
if (null !== $configVar) {
|
||||
return (bool)$configVar->data;
|
||||
@ -157,8 +157,8 @@ class DecryptDatabase extends Command
|
||||
} catch (FireflyException $e) {
|
||||
$message = sprintf('Could not decrypt field "%s" in row #%d of table "%s": %s', $field, $id, $table, $e->getMessage());
|
||||
$this->friendlyError($message);
|
||||
Log::error($message);
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($message);
|
||||
app('log')->error($e->getTraceAsString());
|
||||
}
|
||||
|
||||
// A separate routine for preferences table:
|
||||
|
@ -171,7 +171,7 @@ class TransactionIdentifier extends Command
|
||||
->whereNotIn('id', $exclude)
|
||||
->first();
|
||||
} catch (QueryException $e) {
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
$this->friendlyError('Firefly III could not find the "identifier" field in the "transactions" table.');
|
||||
$this->friendlyError(sprintf('This field is required for Firefly III version %s to run.', config('firefly.version')));
|
||||
$this->friendlyError('Please run "php artisan migrate" to add this field to the table.');
|
||||
|
@ -319,7 +319,7 @@ class TransferCurrenciesCorrections extends Command
|
||||
// source account must have a currency preference.
|
||||
if (null === $this->sourceCurrency) {
|
||||
$message = sprintf('Account #%d ("%s") must have currency preference but has none.', $this->sourceAccount->id, $this->sourceAccount->name);
|
||||
Log::error($message);
|
||||
app('log')->error($message);
|
||||
$this->friendlyError($message);
|
||||
|
||||
return true;
|
||||
@ -332,7 +332,7 @@ class TransferCurrenciesCorrections extends Command
|
||||
$this->destinationAccount->id,
|
||||
$this->destinationAccount->name
|
||||
);
|
||||
Log::error($message);
|
||||
app('log')->error($message);
|
||||
$this->friendlyError($message);
|
||||
|
||||
return true;
|
||||
|
@ -78,19 +78,19 @@ trait VerifiesAccessToken
|
||||
$user = $repository->find($userId);
|
||||
|
||||
if (null === $user) {
|
||||
Log::error(sprintf('verifyAccessToken(): no such user for input "%d"', $userId));
|
||||
app('log')->error(sprintf('verifyAccessToken(): no such user for input "%d"', $userId));
|
||||
|
||||
return false;
|
||||
}
|
||||
$accessToken = app('preferences')->getForUser($user, 'access_token');
|
||||
if (null === $accessToken) {
|
||||
Log::error(sprintf('User #%d has no access token, so cannot access command line options.', $userId));
|
||||
app('log')->error(sprintf('User #%d has no access token, so cannot access command line options.', $userId));
|
||||
|
||||
return false;
|
||||
}
|
||||
if ($accessToken->data !== $token) {
|
||||
Log::error(sprintf('Invalid access token for user #%d.', $userId));
|
||||
Log::error(sprintf('Token given is "%s", expected something else.', $token));
|
||||
app('log')->error(sprintf('Invalid access token for user #%d.', $userId));
|
||||
app('log')->error(sprintf('Token given is "%s", expected something else.', $token));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ class Kernel extends ConsoleKernel
|
||||
{
|
||||
$schedule->call(
|
||||
static function () {
|
||||
Log::error(
|
||||
app('log')->error(
|
||||
'Firefly III no longer users the Laravel scheduler to do cron jobs! Please read the instructions at https://docs.firefly-iii.org/'
|
||||
);
|
||||
echo "\n";
|
||||
|
@ -157,7 +157,7 @@ class GracefulNotFoundHandler extends ExceptionHandler
|
||||
/** @var Account|null $account */
|
||||
$account = $user->accounts()->with(['accountType'])->withTrashed()->find($accountId);
|
||||
if (null === $account) {
|
||||
Log::error(sprintf('Could not find account %d, so give big fat error.', $accountId));
|
||||
app('log')->error(sprintf('Could not find account %d, so give big fat error.', $accountId));
|
||||
|
||||
return parent::render($request, $exception);
|
||||
}
|
||||
@ -186,14 +186,14 @@ class GracefulNotFoundHandler extends ExceptionHandler
|
||||
/** @var TransactionGroup|null $group */
|
||||
$group = $user->transactionGroups()->withTrashed()->find($groupId);
|
||||
if (null === $group) {
|
||||
Log::error(sprintf('Could not find group %d, so give big fat error.', $groupId));
|
||||
app('log')->error(sprintf('Could not find group %d, so give big fat error.', $groupId));
|
||||
|
||||
return parent::render($request, $exception);
|
||||
}
|
||||
/** @var TransactionJournal|null $journal */
|
||||
$journal = $group->transactionJournals()->withTrashed()->first();
|
||||
if (null === $journal) {
|
||||
Log::error(sprintf('Could not find journal for group %d, so give big fat error.', $groupId));
|
||||
app('log')->error(sprintf('Could not find journal for group %d, so give big fat error.', $groupId));
|
||||
|
||||
return parent::render($request, $exception);
|
||||
}
|
||||
@ -224,7 +224,7 @@ class GracefulNotFoundHandler extends ExceptionHandler
|
||||
/** @var Attachment|null $attachment */
|
||||
$attachment = $user->attachments()->withTrashed()->find($attachmentId);
|
||||
if (null === $attachment) {
|
||||
Log::error(sprintf('Could not find attachment %d, so give big fat error.', $attachmentId));
|
||||
app('log')->error(sprintf('Could not find attachment %d, so give big fat error.', $attachmentId));
|
||||
|
||||
return parent::render($request, $exception);
|
||||
}
|
||||
@ -246,7 +246,7 @@ class GracefulNotFoundHandler extends ExceptionHandler
|
||||
}
|
||||
}
|
||||
|
||||
Log::error(sprintf('Could not redirect attachment %d, its linked to a %s.', $attachmentId, $attachment->attachable_type));
|
||||
app('log')->error(sprintf('Could not redirect attachment %d, its linked to a %s.', $attachmentId, $attachment->attachable_type));
|
||||
|
||||
return parent::render($request, $exception);
|
||||
}
|
||||
|
@ -228,16 +228,16 @@ class AccountFactory
|
||||
try {
|
||||
$this->storeOpeningBalance($account, $data);
|
||||
} catch (FireflyException $e) {
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
}
|
||||
|
||||
// create credit liability data (only liabilities)
|
||||
try {
|
||||
$this->storeCreditLiability($account, $data);
|
||||
} catch (FireflyException $e) {
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
}
|
||||
|
||||
// create notes
|
||||
|
@ -80,8 +80,8 @@ class BillFactory
|
||||
]
|
||||
);
|
||||
} catch (QueryException $e) {
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
throw new FireflyException('400000: Could not store bill.', 0, $e);
|
||||
}
|
||||
|
||||
|
@ -76,8 +76,8 @@ class CategoryFactory
|
||||
]
|
||||
);
|
||||
} catch (QueryException $e) {
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
throw new FireflyException('400003: Could not store new category.', 0, $e);
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ class PiggyBankEventFactory
|
||||
|
||||
$repetition = $piggyRepos->getRepetition($piggyBank);
|
||||
if (null === $repetition) {
|
||||
Log::error(sprintf('No piggy bank repetition on %s!', $journal->date->format('Y-m-d')));
|
||||
app('log')->error(sprintf('No piggy bank repetition on %s!', $journal->date->format('Y-m-d')));
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -67,8 +67,8 @@ class RecurrenceFactory
|
||||
$type = $this->findTransactionType(ucfirst($data['recurrence']['type']));
|
||||
} catch (FireflyException $e) {
|
||||
$message = sprintf('Cannot make a recurring transaction of type "%s"', $data['recurrence']['type']);
|
||||
Log::error($message);
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($message);
|
||||
app('log')->error($e->getTraceAsString());
|
||||
|
||||
throw new FireflyException($message, 0, $e);
|
||||
}
|
||||
@ -129,8 +129,8 @@ class RecurrenceFactory
|
||||
try {
|
||||
$this->createTransactions($recurrence, $data['transactions'] ?? []);
|
||||
} catch (FireflyException $e) {
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$recurrence->forceDelete();
|
||||
$message = sprintf('Could not create recurring transaction: %s', $e->getMessage());
|
||||
$this->errors->add('store', $message);
|
||||
|
@ -63,7 +63,7 @@ class TagFactory
|
||||
]
|
||||
);
|
||||
if (null === $newTag) {
|
||||
Log::error(sprintf('TagFactory::findOrCreate("%s") but tag is unexpectedly NULL!', $tag));
|
||||
app('log')->error(sprintf('TagFactory::findOrCreate("%s") but tag is unexpectedly NULL!', $tag));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -67,8 +67,8 @@ class TransactionCurrencyFactory
|
||||
);
|
||||
} catch (QueryException $e) {
|
||||
$result = null;
|
||||
Log::error(sprintf('Could not create new currency: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Could not create new currency: %s', $e->getMessage()));
|
||||
app('log')->error($e->getTraceAsString());
|
||||
throw new FireflyException('400004: Could not store new currency.', 0, $e);
|
||||
}
|
||||
|
||||
|
@ -107,9 +107,9 @@ class TransactionFactory
|
||||
/** @var Transaction|null $result */
|
||||
$result = Transaction::create($data);
|
||||
} catch (QueryException $e) {
|
||||
Log::error(sprintf('Could not create transaction: %s', $e->getMessage()), $data);
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Could not create transaction: %s', $e->getMessage()), $data);
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
throw new FireflyException(sprintf('Query exception when creating transaction: %s', $e->getMessage()), 0, $e);
|
||||
}
|
||||
if (null === $result) {
|
||||
|
@ -110,7 +110,7 @@ class TransactionJournalFactory
|
||||
$collection = new Collection();
|
||||
$transactions = $dataObject['transactions'] ?? [];
|
||||
if (0 === count($transactions)) {
|
||||
Log::error('There are no transactions in the array, the TransactionJournalFactory cannot continue.');
|
||||
app('log')->error('There are no transactions in the array, the TransactionJournalFactory cannot continue.');
|
||||
|
||||
return new Collection();
|
||||
}
|
||||
@ -123,19 +123,19 @@ class TransactionJournalFactory
|
||||
$collection->push($journal);
|
||||
}
|
||||
if (null === $journal) {
|
||||
Log::error('The createJournal() method returned NULL. This may indicate an error.');
|
||||
app('log')->error('The createJournal() method returned NULL. This may indicate an error.');
|
||||
}
|
||||
}
|
||||
} catch (DuplicateTransactionException $e) {
|
||||
app('log')->warning('TransactionJournalFactory::create() caught a duplicate journal in createJournal()');
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$this->forceDeleteOnError($collection);
|
||||
throw new DuplicateTransactionException($e->getMessage(), 0, $e);
|
||||
} catch (FireflyException $e) {
|
||||
app('log')->warning('TransactionJournalFactory::create() caught an exception.');
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$this->forceDeleteOnError($collection);
|
||||
throw new FireflyException($e->getMessage(), 0, $e);
|
||||
}
|
||||
@ -174,8 +174,8 @@ class TransactionJournalFactory
|
||||
// validate source and destination using a new Validator.
|
||||
$this->validateAccounts($row);
|
||||
} catch (FireflyException $e) {
|
||||
Log::error('Could not validate source or destination.');
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error('Could not validate source or destination.');
|
||||
app('log')->error($e->getMessage());
|
||||
|
||||
return null;
|
||||
}
|
||||
@ -250,9 +250,9 @@ class TransactionJournalFactory
|
||||
try {
|
||||
$negative = $transactionFactory->createNegative((string)$row['amount'], (string)$row['foreign_amount']);
|
||||
} catch (FireflyException $e) {
|
||||
Log::error('Exception creating negative transaction.');
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error('Exception creating negative transaction.');
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$this->forceDeleteOnError(new Collection([$journal]));
|
||||
throw new FireflyException($e->getMessage(), 0, $e);
|
||||
}
|
||||
@ -270,9 +270,9 @@ class TransactionJournalFactory
|
||||
try {
|
||||
$transactionFactory->createPositive((string)$row['amount'], (string)$row['foreign_amount']);
|
||||
} catch (FireflyException $e) {
|
||||
Log::error('Exception creating positive transaction.');
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error('Exception creating positive transaction.');
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
app('log')->warning('Delete negative transaction.');
|
||||
$this->forceTrDelete($negative);
|
||||
$this->forceDeleteOnError(new Collection([$journal]));
|
||||
|
@ -60,8 +60,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
->with('doubles', $this->expense)
|
||||
->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Cannot render reports.double.report: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Cannot render reports.double.report: %s', $e->getMessage()));
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$result = sprintf('Could not render report view: %s', $e->getMessage());
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
|
@ -98,8 +98,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
->with('start', $this->start)->with('end', $this->end)->with('accounts', $this->accounts)
|
||||
->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Cannot render reports.audit.report: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Cannot render reports.audit.report: %s', $e->getMessage()));
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$result = sprintf('Could not render report view: %s', $e->getMessage());
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
|
@ -74,8 +74,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
->with('accounts', $this->accounts)
|
||||
->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Cannot render reports.account.report: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Cannot render reports.account.report: %s', $e->getMessage()));
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$result = sprintf('Could not render report view: %s', $e->getMessage());
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
|
@ -76,8 +76,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
->with('accounts', $this->accounts)
|
||||
->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Cannot render reports.category.month: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Cannot render reports.category.month: %s', $e->getMessage()));
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$result = sprintf('Could not render report view: %s', $e->getMessage());
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
|
@ -58,8 +58,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
try {
|
||||
return view('reports.default.month', compact('accountIds', 'reportType'))->with('start', $this->start)->with('end', $this->end)->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Cannot render reports.default.month: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Cannot render reports.default.month: %s', $e->getMessage()));
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$result = 'Could not render report view.';
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
|
@ -62,8 +62,8 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
|
||||
compact('accountIds', 'reportType')
|
||||
)->with('start', $this->start)->with('end', $this->end)->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Cannot render reports.default.multi-year: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Cannot render reports.default.multi-year: %s', $e->getMessage()));
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$result = sprintf('Could not render report view: %s', $e->getMessage());
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
|
@ -62,8 +62,8 @@ class YearReportGenerator implements ReportGeneratorInterface
|
||||
compact('accountIds', 'reportType')
|
||||
)->with('start', $this->start)->with('end', $this->end)->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Cannot render reports.account.report: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Cannot render reports.account.report: %s', $e->getMessage()));
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$result = 'Could not render report view.';
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
|
@ -70,8 +70,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
compact('accountIds', 'reportType', 'tagIds')
|
||||
)->with('start', $this->start)->with('end', $this->end)->with('tags', $this->tags)->with('accounts', $this->accounts)->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Cannot render reports.tag.month: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Cannot render reports.tag.month: %s', $e->getMessage()));
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$result = sprintf('Could not render report view: %s', $e->getMessage());
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ class StandardMessageGenerator implements MessageGeneratorInterface
|
||||
switch ($class) {
|
||||
default:
|
||||
// Line is ignored because all of Firefly III's Models have an id property.
|
||||
Log::error(
|
||||
app('log')->error(
|
||||
sprintf('Webhook #%d was given %s#%d to deal with but can\'t extract user ID from it.', $webhook->id, $class, $model->id)
|
||||
);
|
||||
|
||||
@ -158,7 +158,7 @@ class StandardMessageGenerator implements MessageGeneratorInterface
|
||||
// then depends on the response what to put in the message:
|
||||
switch ($webhook->response) {
|
||||
default:
|
||||
Log::error(
|
||||
app('log')->error(
|
||||
sprintf('The response code for webhook #%d is "%d" and the message generator cant handle it. Soft fail.', $webhook->id, $webhook->response)
|
||||
);
|
||||
|
||||
@ -171,10 +171,10 @@ class StandardMessageGenerator implements MessageGeneratorInterface
|
||||
try {
|
||||
$basicMessage['content'] = $transformer->transformObject($model);
|
||||
} catch (FireflyException $e) {
|
||||
Log::error(
|
||||
app('log')->error(
|
||||
sprintf('The transformer could not include the requested transaction group for webhook #%d: %s', $webhook->id, $e->getMessage())
|
||||
);
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -61,8 +61,8 @@ class APIEventHandler
|
||||
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
return;
|
||||
}
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -69,8 +69,8 @@ class AdminEventHandler
|
||||
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
return;
|
||||
}
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -107,8 +107,8 @@ class AdminEventHandler
|
||||
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
return;
|
||||
}
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -141,8 +141,8 @@ class AdminEventHandler
|
||||
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
return;
|
||||
}
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -85,8 +85,8 @@ class AutomationHandler
|
||||
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
return;
|
||||
}
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
}
|
||||
Log::debug('If there is no error above this line, message was sent.');
|
||||
}
|
||||
|
@ -63,8 +63,8 @@ class BillEventHandler
|
||||
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
return;
|
||||
}
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
}
|
||||
}
|
||||
if (false === $preference) {
|
||||
|
@ -99,7 +99,7 @@ class UserEventHandler
|
||||
if (null === $role) {
|
||||
// create role, does not exist. Very strange situation so let's raise a big fuss about it.
|
||||
$role = $repository->createRole('owner', 'Site Owner', 'User runs this instance of FF3');
|
||||
Log::error('Could not find role "owner". This is weird.');
|
||||
app('log')->error('Could not find role "owner". This is weird.');
|
||||
}
|
||||
|
||||
app('log')->info(sprintf('Gave user #%d role #%d ("%s")', $user->id, $role->id, $role->name));
|
||||
@ -214,8 +214,8 @@ class UserEventHandler
|
||||
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
return;
|
||||
}
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
}
|
||||
}
|
||||
$list[$index]['notified'] = true;
|
||||
@ -248,8 +248,8 @@ class UserEventHandler
|
||||
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
return;
|
||||
}
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -275,8 +275,8 @@ class UserEventHandler
|
||||
try {
|
||||
Mail::to($newEmail)->send(new ConfirmEmailChangeMail($newEmail, $oldEmail, $url));
|
||||
} catch (Exception $e) { // intentional generic exception
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
throw new FireflyException($e->getMessage(), 0, $e);
|
||||
}
|
||||
}
|
||||
@ -300,8 +300,8 @@ class UserEventHandler
|
||||
try {
|
||||
Mail::to($oldEmail)->send(new UndoEmailChangeMail($newEmail, $oldEmail, $url));
|
||||
} catch (Exception $e) { // intentional generic exception
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
throw new FireflyException($e->getMessage(), 0, $e);
|
||||
}
|
||||
}
|
||||
@ -325,8 +325,8 @@ class UserEventHandler
|
||||
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
return;
|
||||
}
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
}
|
||||
}
|
||||
|
||||
@ -344,8 +344,8 @@ class UserEventHandler
|
||||
try {
|
||||
Mail::to($invitee)->send(new InvitationMail($invitee, $admin, $url));
|
||||
} catch (Exception $e) { // intentional generic exception
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
throw new FireflyException($e->getMessage(), 0, $e);
|
||||
}
|
||||
}
|
||||
@ -373,8 +373,8 @@ class UserEventHandler
|
||||
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
return;
|
||||
}
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -399,7 +399,7 @@ class UserEventHandler
|
||||
$preference = app('preferences')->getForUser($user, 'login_ip_history', [])->data;
|
||||
} catch (FireflyException $e) {
|
||||
// don't care.
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
try {
|
||||
$unencryptedData = Crypt::decrypt($encryptedData); // verified
|
||||
} catch (DecryptException $e) {
|
||||
Log::error(sprintf('Could not decrypt data of attachment #%d: %s', $attachment->id, $e->getMessage()));
|
||||
app('log')->error(sprintf('Could not decrypt data of attachment #%d: %s', $attachment->id, $e->getMessage()));
|
||||
$unencryptedData = $encryptedData;
|
||||
}
|
||||
|
||||
@ -141,13 +141,13 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
{
|
||||
$resource = tmpfile();
|
||||
if (false === $resource) {
|
||||
Log::error('Cannot create temp-file for file upload.');
|
||||
app('log')->error('Cannot create temp-file for file upload.');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if ('' === $content) {
|
||||
Log::error('Cannot upload empty file.');
|
||||
app('log')->error('Cannot upload empty file.');
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -158,7 +158,7 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
$mime = finfo_file($finfo, $path);
|
||||
$allowedMime = config('firefly.allowedMimes');
|
||||
if (!in_array($mime, $allowedMime, true)) {
|
||||
Log::error(sprintf('Mime type %s is not allowed for API file upload.', $mime));
|
||||
app('log')->error(sprintf('Mime type %s is not allowed for API file upload.', $mime));
|
||||
fclose($resource);
|
||||
|
||||
return false;
|
||||
@ -284,7 +284,7 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
$result = false;
|
||||
}
|
||||
if (0 === $file->getSize()) {
|
||||
Log::error('Cannot upload empty file.');
|
||||
app('log')->error('Cannot upload empty file.');
|
||||
$result = false;
|
||||
}
|
||||
|
||||
@ -320,7 +320,7 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
if (!in_array($mime, $this->allowedMimes, true)) {
|
||||
$msg = (string)trans('validation.file_invalid_mime', ['name' => $name, 'mime' => $mime]);
|
||||
$this->errors->add('attachments', $msg);
|
||||
Log::error($msg);
|
||||
app('log')->error($msg);
|
||||
|
||||
$result = false;
|
||||
}
|
||||
@ -344,7 +344,7 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
if ($size > $this->maxUploadSize) {
|
||||
$msg = (string)trans('validation.file_too_large', ['name' => $name]);
|
||||
$this->errors->add('attachments', $msg);
|
||||
Log::error($msg);
|
||||
app('log')->error($msg);
|
||||
|
||||
$result = false;
|
||||
}
|
||||
@ -377,7 +377,7 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
if ($count > 0) {
|
||||
$msg = (string)trans('validation.file_already_attached', ['name' => $name]);
|
||||
$this->errors->add('attachments', $msg);
|
||||
Log::error($msg);
|
||||
app('log')->error($msg);
|
||||
$result = true;
|
||||
}
|
||||
|
||||
|
@ -627,7 +627,7 @@ class GroupCollector implements GroupCollectorInterface
|
||||
$result['created_at']->setTimezone(config('app.timezone'));
|
||||
$result['updated_at']->setTimezone(config('app.timezone'));
|
||||
} catch (Exception $e) { // intentional generic exception
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
throw new FireflyException($e->getMessage(), 0, $e);
|
||||
}
|
||||
|
||||
|
@ -50,10 +50,10 @@ class Sha3SignatureGenerator implements SignatureGeneratorInterface
|
||||
try {
|
||||
$json = json_encode($message->message, JSON_THROW_ON_ERROR);
|
||||
} catch (JsonException $e) {
|
||||
Log::error('Could not generate hash.');
|
||||
Log::error(sprintf('JSON value: %s', $json));
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error('Could not generate hash.');
|
||||
app('log')->error(sprintf('JSON value: %s', $json));
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
throw new FireflyException('Could not generate JSON for SHA3 hash.', 0, $e);
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ class ForgotPasswordController extends Controller
|
||||
app('log')->info('Start of sendResetLinkEmail()');
|
||||
if ('web' !== config('firefly.authentication_guard')) {
|
||||
$message = sprintf('Cannot reset password when authenticating over "%s".', config('firefly.authentication_guard'));
|
||||
Log::error($message);
|
||||
app('log')->error($message);
|
||||
|
||||
return view('error', compact('message'));
|
||||
}
|
||||
@ -92,7 +92,7 @@ class ForgotPasswordController extends Controller
|
||||
// need to show to the user. Finally, we'll send out a proper response.
|
||||
$result = $this->broker()->sendResetLink($request->only('email'));
|
||||
if ('passwords.throttled' === $result) {
|
||||
Log::error(sprintf('Cowardly refuse to send a password reset message to user #%d because the reset button has been throttled.', $user->id));
|
||||
app('log')->error(sprintf('Cowardly refuse to send a password reset message to user #%d because the reset button has been throttled.', $user->id));
|
||||
}
|
||||
|
||||
// always send the same response to the user:
|
||||
|
@ -98,7 +98,7 @@ class LoginController extends Controller
|
||||
// the IP address of the client making these requests into this application.
|
||||
if (method_exists($this, 'hasTooManyLoginAttempts') && $this->hasTooManyLoginAttempts($request)) {
|
||||
Log::channel('audit')->info(sprintf('Login for user "%s" was locked out.', $request->get($this->username())));
|
||||
Log::error(sprintf('Login for user "%s" was locked out.', $request->get($this->username())));
|
||||
app('log')->error(sprintf('Login for user "%s" was locked out.', $request->get($this->username())));
|
||||
$this->fireLockoutEvent($request);
|
||||
|
||||
$this->sendLockoutResponse($request);
|
||||
|
@ -107,7 +107,7 @@ class CreateController extends Controller
|
||||
try {
|
||||
$bill = $this->repository->store($billData);
|
||||
} catch (FireflyException $e) {
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
$request->session()->flash('error', (string)trans('firefly.bill_store_error'));
|
||||
|
||||
return redirect(route('bills.create'))->withInput();
|
||||
|
@ -73,7 +73,7 @@ class DebugController extends Controller
|
||||
app('log')->info('This is a test message at the INFO level.');
|
||||
Log::notice('This is a test message at the NOTICE level.');
|
||||
app('log')->warning('This is a test message at the WARNING level.');
|
||||
Log::error('This is a test message at the ERROR level.');
|
||||
app('log')->error('This is a test message at the ERROR level.');
|
||||
Log::critical('This is a test message at the CRITICAL level.');
|
||||
Log::alert('This is a test message at the ALERT level.');
|
||||
Log::emergency('This is a test message at the EMERGENCY level.');
|
||||
|
@ -71,14 +71,14 @@ class HomeController extends Controller
|
||||
$stringStart = e((string)$request->get('start'));
|
||||
$start = Carbon::createFromFormat('Y-m-d', $stringStart);
|
||||
} catch (InvalidFormatException $e) {
|
||||
Log::error(sprintf('Start: could not parse date string "%s" so ignore it.', $stringStart));
|
||||
app('log')->error(sprintf('Start: could not parse date string "%s" so ignore it.', $stringStart));
|
||||
$start = Carbon::now()->startOfMonth();
|
||||
}
|
||||
try {
|
||||
$stringEnd = e((string)$request->get('end'));
|
||||
$end = Carbon::createFromFormat('Y-m-d', $stringEnd);
|
||||
} catch (InvalidFormatException $e) {
|
||||
Log::error(sprintf('End could not parse date string "%s" so ignore it.', $stringEnd));
|
||||
app('log')->error(sprintf('End could not parse date string "%s" so ignore it.', $stringEnd));
|
||||
$end = Carbon::now()->endOfMonth();
|
||||
}
|
||||
$label = $request->get('label');
|
||||
|
@ -74,8 +74,8 @@ class FrontpageController extends Controller
|
||||
try {
|
||||
$html = view('json.piggy-banks', compact('info'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Cannot render json.piggy-banks: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Cannot render json.piggy-banks: %s', $e->getMessage()));
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$html = 'Could not render view.';
|
||||
throw new FireflyException($html, 0, $e);
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ class ReconcileController extends Controller
|
||||
)->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::debug(sprintf('View error: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$view = sprintf('Could not render accounts.reconcile.overview: %s', $e->getMessage());
|
||||
throw new FireflyException($view, 0, $e);
|
||||
}
|
||||
@ -259,7 +259,7 @@ class ReconcileController extends Controller
|
||||
)->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::debug(sprintf('Could not render: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$html = sprintf('Could not render accounts.reconcile.transactions: %s', $e->getMessage());
|
||||
throw new FireflyException($html, 0, $e);
|
||||
}
|
||||
|
@ -54,8 +54,8 @@ class RuleController extends Controller
|
||||
try {
|
||||
$view = view('rules.partials.action', compact('actions', 'count'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Cannot render rules.partials.action: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Cannot render rules.partials.action: %s', $e->getMessage()));
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$view = 'Could not render view.';
|
||||
throw new FireflyException($view, 0, $e);
|
||||
}
|
||||
@ -86,8 +86,8 @@ class RuleController extends Controller
|
||||
try {
|
||||
$view = view('rules.partials.trigger', compact('triggers', 'count'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Cannot render rules.partials.trigger: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Cannot render rules.partials.trigger: %s', $e->getMessage()));
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$view = 'Could not render view.';
|
||||
throw new FireflyException($view, 0, $e);
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ class AmountController extends Controller
|
||||
return redirect(route('piggy-banks.index'));
|
||||
}
|
||||
|
||||
Log::error('Cannot add ' . $amount . ' because canAddAmount returned false.');
|
||||
app('log')->error('Cannot add ' . $amount . ' because canAddAmount returned false.');
|
||||
session()->flash(
|
||||
'error',
|
||||
(string)trans(
|
||||
|
@ -124,7 +124,7 @@ class PreferencesController extends Controller
|
||||
try {
|
||||
$locales = json_decode(file_get_contents(resource_path(sprintf('lang/%s/locales.json', $language))), true, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (JsonException $e) {
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
$locales = [];
|
||||
}
|
||||
$locales = ['equal' => (string)trans('firefly.equal_to_language')] + $locales;
|
||||
|
@ -65,8 +65,8 @@ class AccountController extends Controller
|
||||
try {
|
||||
$result = view('reports.partials.accounts', compact('accountReport'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Could not render reports.partials.accounts: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Could not render reports.partials.accounts: %s', $e->getMessage()));
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$result = 'Could not render view.';
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
|
@ -141,8 +141,8 @@ class BalanceController extends Controller
|
||||
try {
|
||||
$result = view('reports.partials.balance', compact('report'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Could not render reports.partials.balance: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Could not render reports.partials.balance: %s', $e->getMessage()));
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$result = 'Could not render view.';
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
|
@ -61,8 +61,8 @@ class BillController extends Controller
|
||||
try {
|
||||
$result = view('reports.partials.bills', compact('report'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Could not render reports.partials.budgets: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Could not render reports.partials.budgets: %s', $e->getMessage()));
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$result = 'Could not render view.';
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
|
@ -195,9 +195,9 @@ class BudgetController extends Controller
|
||||
try {
|
||||
$result = view('reports.budget.partials.avg-expenses', compact('result'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage()));
|
||||
$result = sprintf('Could not render view: %s', $e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
|
||||
@ -354,8 +354,8 @@ class BudgetController extends Controller
|
||||
try {
|
||||
$result = view('reports.partials.budget-period', compact('report', 'periods'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage()));
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$result = 'Could not render view.';
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
@ -408,7 +408,7 @@ class BudgetController extends Controller
|
||||
try {
|
||||
$result = view('reports.budget.partials.top-expenses', compact('result'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage()));
|
||||
$result = sprintf('Could not render view: %s', $e->getMessage());
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
|
@ -315,7 +315,7 @@ class CategoryController extends Controller
|
||||
try {
|
||||
$result = view('reports.category.partials.avg-expenses', compact('result'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage()));
|
||||
$result = sprintf('Could not render view: %s', $e->getMessage());
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
@ -368,7 +368,7 @@ class CategoryController extends Controller
|
||||
try {
|
||||
$result = view('reports.category.partials.avg-income', compact('result'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage()));
|
||||
$result = sprintf('Could not render view: %s', $e->getMessage());
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
@ -553,7 +553,7 @@ class CategoryController extends Controller
|
||||
try {
|
||||
$result = view('reports.partials.category-period', compact('report', 'periods'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Could not render category::expenses: %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('Could not render category::expenses: %s', $e->getMessage()));
|
||||
$result = sprintf('An error prevented Firefly III from rendering: %s. Apologies.', $e->getMessage());
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
@ -632,7 +632,7 @@ class CategoryController extends Controller
|
||||
try {
|
||||
$result = view('reports.partials.category-period', compact('report', 'periods'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Could not render category::expenses: %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('Could not render category::expenses: %s', $e->getMessage()));
|
||||
$result = sprintf('An error prevented Firefly III from rendering: %s. Apologies.', $e->getMessage());
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
@ -678,7 +678,7 @@ class CategoryController extends Controller
|
||||
$result = (string)view('reports.partials.categories', compact('report'))->render();
|
||||
$cache->store($result);
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Could not render category::expenses: %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('Could not render category::expenses: %s', $e->getMessage()));
|
||||
$result = sprintf('An error prevented Firefly III from rendering: %s. Apologies.', $e->getMessage());
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ class DoubleController extends Controller
|
||||
try {
|
||||
$result = view('reports.double.partials.avg-expenses', compact('result'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage()));
|
||||
$result = sprintf('Could not render view: %s', $e->getMessage());
|
||||
throw new FireflyException($e->getMessage(), 0, $e);
|
||||
}
|
||||
@ -168,7 +168,7 @@ class DoubleController extends Controller
|
||||
try {
|
||||
$result = view('reports.double.partials.avg-income', compact('result'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage()));
|
||||
$result = sprintf('Could not render view: %s', $e->getMessage());
|
||||
throw new FireflyException($e->getMessage(), 0, $e);
|
||||
}
|
||||
@ -463,7 +463,7 @@ class DoubleController extends Controller
|
||||
try {
|
||||
$result = view('reports.double.partials.top-expenses', compact('result'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage()));
|
||||
$result = sprintf('Could not render view: %s', $e->getMessage());
|
||||
throw new FireflyException($e->getMessage(), 0, $e);
|
||||
}
|
||||
@ -514,7 +514,7 @@ class DoubleController extends Controller
|
||||
try {
|
||||
$result = view('reports.double.partials.top-income', compact('result'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage()));
|
||||
$result = sprintf('Could not render view: %s', $e->getMessage());
|
||||
throw new FireflyException($e->getMessage(), 0, $e);
|
||||
}
|
||||
|
@ -85,8 +85,8 @@ class OperationsController extends Controller
|
||||
try {
|
||||
$result = view('reports.partials.income-expenses', compact('report', 'type'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Could not render reports.partials.income-expense: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Could not render reports.partials.income-expense: %s', $e->getMessage()));
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$result = 'Could not render view.';
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
@ -122,8 +122,8 @@ class OperationsController extends Controller
|
||||
try {
|
||||
$result = view('reports.partials.income-expenses', compact('report', 'type'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Could not render reports.partials.income-expenses: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Could not render reports.partials.income-expenses: %s', $e->getMessage()));
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$result = 'Could not render view.';
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
@ -179,8 +179,8 @@ class OperationsController extends Controller
|
||||
try {
|
||||
$result = view('reports.partials.operations', compact('sums'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Could not render reports.partials.operations: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Could not render reports.partials.operations: %s', $e->getMessage()));
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$result = 'Could not render view.';
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ class EditController extends Controller
|
||||
} catch (Throwable $e) {
|
||||
$message = sprintf('Throwable was thrown in getPreviousTriggers(): %s', $e->getMessage());
|
||||
Log::debug($message);
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
throw new FireflyException($message, 0, $e);
|
||||
}
|
||||
$index++;
|
||||
|
@ -183,8 +183,8 @@ class SelectController extends Controller
|
||||
try {
|
||||
$view = view('list.journals-array-tiny', ['groups' => $collection])->render();
|
||||
} catch (Throwable $exception) {
|
||||
Log::error(sprintf('Could not render view in testTriggers(): %s', $exception->getMessage()));
|
||||
Log::error($exception->getTraceAsString());
|
||||
app('log')->error(sprintf('Could not render view in testTriggers(): %s', $exception->getMessage()));
|
||||
app('log')->error($exception->getTraceAsString());
|
||||
$view = sprintf('Could not render list.journals-tiny: %s', $exception->getMessage());
|
||||
throw new FireflyException($view, 0, $exception);
|
||||
}
|
||||
@ -227,8 +227,8 @@ class SelectController extends Controller
|
||||
$view = view('list.journals-array-tiny', ['groups' => $collection])->render();
|
||||
} catch (Throwable $exception) {
|
||||
$message = sprintf('Could not render view in testTriggersByRule(): %s', $exception->getMessage());
|
||||
Log::error($message);
|
||||
Log::error($exception->getTraceAsString());
|
||||
app('log')->error($message);
|
||||
app('log')->error($exception->getTraceAsString());
|
||||
throw new FireflyException($message, 0, $exception);
|
||||
}
|
||||
|
||||
|
@ -127,8 +127,8 @@ class SearchController extends Controller
|
||||
try {
|
||||
$html = view('search.search', compact('groups', 'hasPages', 'searchTime'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Cannot render search.search: %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Cannot render search.search: %s', $e->getMessage()));
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$html = 'Could not render view.';
|
||||
throw new FireflyException($html, 0, $e);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ class CronController
|
||||
*/
|
||||
public function cron()
|
||||
{
|
||||
Log::error('The cron endpoint has moved to GET /api/v1/cron/[token]');
|
||||
app('log')->error('The cron endpoint has moved to GET /api/v1/cron/[token]');
|
||||
|
||||
return response('The cron endpoint has moved to GET /api/v1/cron/[token]', 500);
|
||||
}
|
||||
|
@ -116,8 +116,8 @@ class InstallController extends Controller
|
||||
try {
|
||||
$result = $this->executeCommand($command, $parameters);
|
||||
} catch (FireflyException $e) {
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
if (strpos($e->getMessage(), 'open_basedir restriction in effect')) {
|
||||
$this->lastError = self::BASEDIR_ERROR;
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ class CreateController extends Controller
|
||||
$user = auth()->user();
|
||||
$data = $request->getCurrencyData();
|
||||
if (!$this->userRepository->hasRole($user, 'owner')) {
|
||||
Log::error('User ' . auth()->user()->id . ' is not admin, but tried to store a currency.');
|
||||
app('log')->error('User ' . auth()->user()->id . ' is not admin, but tried to store a currency.');
|
||||
Log::channel('audit')->info('Tried to create (POST) currency without admin rights.', $data);
|
||||
|
||||
return redirect($this->getPreviousUrl('currencies.create.url'))->withInput();
|
||||
@ -121,7 +121,7 @@ class CreateController extends Controller
|
||||
try {
|
||||
$currency = $this->repository->store($data);
|
||||
} catch (FireflyException $e) {
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
Log::channel('audit')->info('Could not store (POST) currency without admin rights.', $data);
|
||||
$request->session()->flash('error', (string)trans('firefly.could_not_store_currency'));
|
||||
$currency = null;
|
||||
|
@ -92,7 +92,7 @@ class Installer
|
||||
DB::table('users')->count();
|
||||
} catch (QueryException $e) {
|
||||
$message = $e->getMessage();
|
||||
Log::error(sprintf('Error message trying to access users-table: %s', $message));
|
||||
app('log')->error(sprintf('Error message trying to access users-table: %s', $message));
|
||||
if ($this->isAccessDenied($message)) {
|
||||
throw new FireflyException(
|
||||
'It seems your database configuration is not correct. Please verify the username and password in your .env file.',
|
||||
|
@ -108,7 +108,7 @@ class Range
|
||||
|
||||
// send error to view, if could not set money format
|
||||
if (false === $moneyResult) {
|
||||
Log::error('Could not set locale. The following array doesnt work: ', $localeArray);
|
||||
app('log')->error('Could not set locale. The following array doesnt work: ', $localeArray);
|
||||
app('view')->share('invalidMonetaryLocale', true);
|
||||
}
|
||||
|
||||
|
@ -157,14 +157,14 @@ class ReportFormRequest extends FormRequest
|
||||
$date = new Carbon($parts[1]);
|
||||
} catch (Exception $e) { // intentional generic exception
|
||||
$error = sprintf('"%s" is not a valid date range: %s', $range, $e->getMessage());
|
||||
Log::error($error);
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($error);
|
||||
app('log')->error($e->getTraceAsString());
|
||||
throw new FireflyException($error, 0, $e);
|
||||
}
|
||||
return $date;
|
||||
}
|
||||
$error = sprintf('"%s" is not a valid date range: %s', $range, 'invalid format :(');
|
||||
Log::error($error);
|
||||
app('log')->error($error);
|
||||
throw new FireflyException($error, 0);
|
||||
}
|
||||
return $date;
|
||||
@ -192,14 +192,14 @@ class ReportFormRequest extends FormRequest
|
||||
$date = new Carbon($parts[0]);
|
||||
} catch (Exception $e) { // intentional generic exception
|
||||
$error = sprintf('"%s" is not a valid date range: %s', $range, $e->getMessage());
|
||||
Log::error($error);
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($error);
|
||||
app('log')->error($e->getTraceAsString());
|
||||
throw new FireflyException($error, 0, $e);
|
||||
}
|
||||
return $date;
|
||||
}
|
||||
$error = sprintf('"%s" is not a valid date range: %s', $range, 'invalid format :(');
|
||||
Log::error($error);
|
||||
app('log')->error($error);
|
||||
throw new FireflyException($error, 0);
|
||||
}
|
||||
|
||||
@ -221,7 +221,7 @@ class ReportFormRequest extends FormRequest
|
||||
Log::debug('Set is:', $set);
|
||||
}
|
||||
if (!is_array($set)) {
|
||||
Log::error(sprintf('Set is not an array! "%s"', $set));
|
||||
app('log')->error(sprintf('Set is not an array! "%s"', $set));
|
||||
return $collection;
|
||||
}
|
||||
foreach ($set as $tagTag) {
|
||||
|
@ -417,7 +417,7 @@ class CreateRecurringTransactions implements ShouldQueue
|
||||
$groupTitle = $first->description;
|
||||
}
|
||||
if (0 === $count) {
|
||||
Log::error('No transactions to be created in this recurrence. Cannot continue.');
|
||||
app('log')->error('No transactions to be created in this recurrence. Cannot continue.');
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ class MailError extends Job implements ShouldQueue
|
||||
$debug = $exceptionData;
|
||||
unset($debug['stackTrace']);
|
||||
unset($debug['headers']);
|
||||
Log::error(sprintf('Exception is: %s', json_encode($debug)));
|
||||
app('log')->error(sprintf('Exception is: %s', json_encode($debug)));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -102,8 +102,8 @@ class MailError extends Job implements ShouldQueue
|
||||
app('log')->warning('[RFC] Could not email or log the error. Please validate your email settings, use the .env.example file as a guide.');
|
||||
return;
|
||||
}
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ class NewIPAddressWarningMail extends Mailable
|
||||
try {
|
||||
$hostName = app('steam')->getHostName($this->ipAddress);
|
||||
} catch (FireflyException $e) {
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
$hostName = $this->ipAddress;
|
||||
}
|
||||
if ($hostName !== $this->ipAddress) {
|
||||
|
@ -80,7 +80,7 @@ class UserLogin extends Notification
|
||||
try {
|
||||
$hostName = app('steam')->getHostName($this->ip);
|
||||
} catch (FireflyException $e) {
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
$hostName = $this->ip;
|
||||
}
|
||||
if ($hostName !== $this->ip) {
|
||||
@ -105,7 +105,7 @@ class UserLogin extends Notification
|
||||
try {
|
||||
$hostName = app('steam')->getHostName($this->ip);
|
||||
} catch (FireflyException $e) {
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
$hostName = $this->ip;
|
||||
}
|
||||
if ($hostName !== $this->ip) {
|
||||
|
@ -207,7 +207,7 @@ class AttachmentRepository implements AttachmentRepositoryInterface
|
||||
try {
|
||||
$dbNote->delete();
|
||||
} catch (LogicException $e) {
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -807,8 +807,8 @@ class BudgetRepository implements BudgetRepositoryInterface
|
||||
]
|
||||
);
|
||||
} catch (QueryException $e) {
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
throw new FireflyException('400002: Could not store budget.', 0, $e);
|
||||
}
|
||||
|
||||
|
@ -252,7 +252,7 @@ trait ModifiesPiggyBanks
|
||||
/** @var PiggyBank $piggyBank */
|
||||
$piggyBank = PiggyBank::create($piggyData);
|
||||
} catch (QueryException $e) {
|
||||
Log::error(sprintf('Could not store piggy bank: %s', $e->getMessage()), $piggyData);
|
||||
app('log')->error(sprintf('Could not store piggy bank: %s', $e->getMessage()), $piggyData);
|
||||
throw new FireflyException('400005: Could not store new piggy bank.', 0, $e);
|
||||
}
|
||||
|
||||
|
@ -480,8 +480,8 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface
|
||||
throw new DuplicateTransactionException($e->getMessage(), 0, $e);
|
||||
} catch (FireflyException $e) {
|
||||
app('log')->warning('Group repository caught group factory with an exception!');
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
throw new FireflyException($e->getMessage(), 0, $e);
|
||||
}
|
||||
}
|
||||
|
@ -385,7 +385,7 @@ class UserRepository implements UserRepositoryInterface
|
||||
{
|
||||
$roleObject = Role::where('name', $role)->first();
|
||||
if (null === $roleObject) {
|
||||
Log::error(sprintf('Could not find role "%s" in attachRole()', $role));
|
||||
app('log')->error(sprintf('Could not find role "%s" in attachRole()', $role));
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -394,7 +394,7 @@ class UserRepository implements UserRepositoryInterface
|
||||
$user->roles()->attach($roleObject);
|
||||
} catch (QueryException $e) {
|
||||
// don't care
|
||||
Log::error(sprintf('Query exception when giving user a role: %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('Query exception when giving user a role: %s', $e->getMessage()));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -64,11 +64,11 @@ class IsDateOrTime implements Rule
|
||||
try {
|
||||
Carbon::createFromFormat('Y-m-d', $value);
|
||||
} catch (InvalidDateException $e) {
|
||||
Log::error(sprintf('"%s" is not a valid date: %s', $value, $e->getMessage()));
|
||||
app('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()));
|
||||
app('log')->error(sprintf('"%s" is of an invalid format: %s', $value, $e->getMessage()));
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -79,11 +79,11 @@ class IsDateOrTime implements Rule
|
||||
try {
|
||||
Carbon::parse($value);
|
||||
} catch (InvalidDateException $e) {
|
||||
Log::error(sprintf('"%s" is not a valid date or time: %s', $value, $e->getMessage()));
|
||||
app('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()));
|
||||
app('log')->error(sprintf('"%s" is of an invalid format: %s', $value, $e->getMessage()));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ class IsValidAttachmentModel implements Rule
|
||||
TransactionJournal::class => 'validateJournal',
|
||||
];
|
||||
if (!array_key_exists($this->model, $methods)) {
|
||||
Log::error(sprintf('Cannot validate model "%s" in %s.', substr($this->model, 0, 20), __METHOD__));
|
||||
app('log')->error(sprintf('Cannot validate model "%s" in %s.', substr($this->model, 0, 20), __METHOD__));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -52,8 +52,8 @@ class UpdateRequest implements UpdateRequestInterface
|
||||
// try get array from update server:
|
||||
$updateInfo = $this->contactServer($channel);
|
||||
if ('error' === $updateInfo['level']) {
|
||||
Log::error('Update information contains an error.');
|
||||
Log::error($updateInfo['message']);
|
||||
app('log')->error('Update information contains an error.');
|
||||
app('log')->error($updateInfo['message']);
|
||||
$information['message'] = $updateInfo['message'];
|
||||
|
||||
return $information;
|
||||
@ -91,17 +91,17 @@ class UpdateRequest implements UpdateRequestInterface
|
||||
];
|
||||
$res = $client->request('GET', $url, $options);
|
||||
} catch (GuzzleException $e) {
|
||||
Log::error('Ran into Guzzle error.');
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error('Ran into Guzzle error.');
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$return['message'] = sprintf('Guzzle: %s', strip_tags($e->getMessage()));
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
if (200 !== $res->getStatusCode()) {
|
||||
Log::error(sprintf('Response status from server is %d.', $res->getStatusCode()));
|
||||
Log::error((string)$res->getBody());
|
||||
app('log')->error(sprintf('Response status from server is %d.', $res->getStatusCode()));
|
||||
app('log')->error((string)$res->getBody());
|
||||
$return['message'] = sprintf('Error: %d', $res->getStatusCode());
|
||||
|
||||
return $return;
|
||||
@ -110,16 +110,16 @@ class UpdateRequest implements UpdateRequestInterface
|
||||
try {
|
||||
$json = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (JsonException $e) {
|
||||
Log::error('Body is not valid JSON');
|
||||
Log::error($body);
|
||||
app('log')->error('Body is not valid JSON');
|
||||
app('log')->error($body);
|
||||
$return['message'] = 'Invalid JSON :(';
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
if (!array_key_exists($channel, $json['firefly_iii'])) {
|
||||
Log::error(sprintf('No valid update channel "%s"', $channel));
|
||||
Log::error($body);
|
||||
app('log')->error(sprintf('No valid update channel "%s"', $channel));
|
||||
app('log')->error($body);
|
||||
$return['message'] = sprintf('Unknown update channel "%s" :(', $channel);
|
||||
}
|
||||
|
||||
|
@ -298,8 +298,8 @@ trait AccountServiceTrait
|
||||
try {
|
||||
$group = $factory->create($submission);
|
||||
} catch (DuplicateTransactionException $e) {
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
throw new FireflyException($e->getMessage(), 0, $e);
|
||||
}
|
||||
|
||||
@ -543,8 +543,8 @@ trait AccountServiceTrait
|
||||
try {
|
||||
$group = $factory->create($submission);
|
||||
} catch (DuplicateTransactionException $e) {
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
throw new FireflyException($e->getMessage(), 0, $e);
|
||||
}
|
||||
|
||||
@ -758,8 +758,8 @@ trait AccountServiceTrait
|
||||
try {
|
||||
$group = $factory->create($submission);
|
||||
} catch (DuplicateTransactionException $e) {
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
throw new FireflyException($e->getMessage(), 0, $e);
|
||||
}
|
||||
|
||||
|
@ -85,8 +85,8 @@ class CreditRecalculateService
|
||||
try {
|
||||
$this->findByJournal($journal);
|
||||
} catch (FireflyException $e) {
|
||||
Log::error($e->getTraceAsString());
|
||||
Log::error(sprintf('Could not find work account for transaction group #%d.', $this->group->id));
|
||||
app('log')->error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Could not find work account for transaction group #%d.', $this->group->id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -222,7 +222,7 @@ trait RecurringTransactionTrait
|
||||
try {
|
||||
$result = $factory->findOrCreate($accountName, $expectedType);
|
||||
} catch (FireflyException $e) {
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ trait TransactionTypeTrait
|
||||
$factory = app(TransactionTypeFactory::class);
|
||||
$transactionType = $factory->find($type);
|
||||
if (null === $transactionType) {
|
||||
Log::error(sprintf('Could not find transaction type for "%s"', $type));
|
||||
app('log')->error(sprintf('Could not find transaction type for "%s"', $type));
|
||||
throw new FireflyException(sprintf('Could not find transaction type for "%s"', $type));
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,7 @@ class GroupUpdateService
|
||||
Log::debug('Array of updated IDs: ', $updated);
|
||||
|
||||
if (0 === count($updated)) {
|
||||
Log::error('There were no transactions updated or created. Will not delete anything.');
|
||||
app('log')->error('There were no transactions updated or created. Will not delete anything.');
|
||||
$transactionGroup->refresh();
|
||||
app('preferences')->mark();
|
||||
|
||||
@ -197,7 +197,7 @@ class GroupUpdateService
|
||||
$updated[] = $newJournal->id;
|
||||
}
|
||||
if (null === $newJournal) {
|
||||
Log::error('createTransactionJournal returned NULL, indicating something went wrong.');
|
||||
app('log')->error('createTransactionJournal returned NULL, indicating something went wrong.');
|
||||
}
|
||||
}
|
||||
if (null !== $journal) {
|
||||
@ -234,8 +234,8 @@ class GroupUpdateService
|
||||
try {
|
||||
$collection = $factory->create($submission);
|
||||
} catch (FireflyException $e) {
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
throw new FireflyException(
|
||||
sprintf('Could not create new transaction journal: %s', $e->getMessage()),
|
||||
0,
|
||||
|
@ -384,7 +384,7 @@ class JournalUpdateService
|
||||
try {
|
||||
$result = $this->getAccount($expectedType, 'source', $sourceInfo);
|
||||
} catch (FireflyException $e) {
|
||||
Log::error(sprintf('Cant get the valid source account: %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('Cant get the valid source account: %s', $e->getMessage()));
|
||||
|
||||
$result = $this->getOriginalSourceAccount();
|
||||
}
|
||||
@ -404,7 +404,7 @@ class JournalUpdateService
|
||||
|
||||
// cowardly refuse to update if both accounts are the same.
|
||||
if ($source->id === $destination->id) {
|
||||
Log::error(sprintf('Source + dest accounts are equal (%d, "%s")', $source->id, $source->name));
|
||||
app('log')->error(sprintf('Source + dest accounts are equal (%d, "%s")', $source->id, $source->name));
|
||||
|
||||
return;
|
||||
}
|
||||
@ -451,7 +451,7 @@ class JournalUpdateService
|
||||
try {
|
||||
$result = $this->getAccount($expectedType, 'destination', $destInfo);
|
||||
} catch (FireflyException $e) {
|
||||
Log::error(sprintf('getValidDestinationAccount() threw unexpected error: %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('getValidDestinationAccount() threw unexpected error: %s', $e->getMessage()));
|
||||
$result = $this->getOriginalDestinationAccount();
|
||||
}
|
||||
|
||||
@ -766,7 +766,7 @@ class JournalUpdateService
|
||||
|
||||
// not the same as normal currency
|
||||
if (null !== $foreignCurrency && $foreignCurrency->id === $this->transactionJournal->transaction_currency_id) {
|
||||
Log::error(sprintf('Foreign currency is equal to normal currency (%s)', $foreignCurrency->code));
|
||||
app('log')->error(sprintf('Foreign currency is equal to normal currency (%s)', $foreignCurrency->code));
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ class PwndVerifierV2 implements Verifier
|
||||
$client = new Client();
|
||||
$res = $client->request('GET', $url, $opt);
|
||||
} catch (GuzzleException | RequestException $e) {
|
||||
Log::error(sprintf('Could not verify password security: %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('Could not verify password security: %s', $e->getMessage()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -62,9 +62,9 @@ class StandardWebhookSender implements WebhookSenderInterface
|
||||
try {
|
||||
$signature = $signatureGenerator->generate($this->message);
|
||||
} catch (FireflyException $e) {
|
||||
Log::error('Did not send message because of a Firefly III Exception.');
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error('Did not send message because of a Firefly III Exception.');
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$attempt = new WebhookAttempt();
|
||||
$attempt->webhookMessage()->associate($this->message);
|
||||
$attempt->status_code = 0;
|
||||
@ -82,9 +82,9 @@ class StandardWebhookSender implements WebhookSenderInterface
|
||||
try {
|
||||
$json = json_encode($this->message->message, JSON_THROW_ON_ERROR);
|
||||
} catch (JsonException $e) {
|
||||
Log::error('Did not send message because of a JSON error.');
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error('Did not send message because of a JSON error.');
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$attempt = new WebhookAttempt();
|
||||
$attempt->webhookMessage()->associate($this->message);
|
||||
$attempt->status_code = 0;
|
||||
@ -111,9 +111,9 @@ class StandardWebhookSender implements WebhookSenderInterface
|
||||
try {
|
||||
$res = $client->request('POST', $this->message->webhook->url, $options);
|
||||
} catch (RequestException | ConnectException $e) {
|
||||
Log::error('The webhook could NOT be submitted but Firefly III caught the error below.');
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error('The webhook could NOT be submitted but Firefly III caught the error below.');
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
|
||||
|
||||
$logs = sprintf("%s\n%s", $e->getMessage(), $e->getTraceAsString());
|
||||
@ -127,9 +127,9 @@ class StandardWebhookSender implements WebhookSenderInterface
|
||||
$attempt->status_code = 0;
|
||||
if (method_exists($e, 'hasResponse') && method_exists($e, 'getResponse')) {
|
||||
$attempt->status_code = $e->hasResponse() ? $e->getResponse()->getStatusCode() : 0;
|
||||
Log::error(sprintf('The status code of the error response is: %d', $attempt->status_code));
|
||||
app('log')->error(sprintf('The status code of the error response is: %d', $attempt->status_code));
|
||||
$body = (string)($e->hasResponse() ? $e->getResponse()->getBody() : '');
|
||||
Log::error(sprintf('The body of the error response is: %s', $body));
|
||||
app('log')->error(sprintf('The body of the error response is: %s', $body));
|
||||
}
|
||||
$attempt->logs = $logs;
|
||||
$attempt->save();
|
||||
|
@ -84,7 +84,7 @@ class RemoteUserGuard implements Guard
|
||||
}
|
||||
|
||||
if (null === $userID || '' === $userID) {
|
||||
Log::error(sprintf('No user in header "%s".', $header));
|
||||
app('log')->error(sprintf('No user in header "%s".', $header));
|
||||
throw new FireflyException('The guard header was unexpectedly empty. See the logs.');
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ class AccountList implements BinderInterface
|
||||
return $collection;
|
||||
}
|
||||
}
|
||||
Log::error(sprintf('Trying to show account list (%s), but user is not logged in or list is empty.', $route->uri));
|
||||
app('log')->error(sprintf('Trying to show account list (%s), but user is not logged in or list is empty.', $route->uri));
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ class CLIToken implements BinderInterface
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
Log::error(sprintf('Recognized no users by access token "%s"', $value));
|
||||
app('log')->error(sprintf('Recognized no users by access token "%s"', $value));
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ class Date implements BinderInterface
|
||||
$result = new Carbon($value);
|
||||
} catch (InvalidDateException $e) {
|
||||
$message = sprintf('Could not parse date "%s" for user #%d: %s', $value, auth()->user()->id, $e->getMessage());
|
||||
Log::error($message);
|
||||
app('log')->error($message);
|
||||
throw new NotFoundHttpException($message, $e);
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ class TagList implements BinderInterface
|
||||
Log::debug('List of tags is', $list);
|
||||
|
||||
if (0 === count($list)) {
|
||||
Log::error('Tag list is empty.');
|
||||
app('log')->error('Tag list is empty.');
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
|
||||
@ -81,7 +81,7 @@ class TagList implements BinderInterface
|
||||
return $collection;
|
||||
}
|
||||
}
|
||||
Log::error('TagList: user is not logged in.');
|
||||
app('log')->error('TagList: user is not logged in.');
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
}
|
||||
|
@ -54,10 +54,10 @@ class TagOrId implements BinderInterface
|
||||
if (null !== $result) {
|
||||
return $result;
|
||||
}
|
||||
Log::error('TagOrId: tag not found.');
|
||||
app('log')->error('TagOrId: tag not found.');
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
Log::error('TagOrId: user is not logged in.');
|
||||
app('log')->error('TagOrId: user is not logged in.');
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ class ExpandedForm
|
||||
try {
|
||||
$html = view('form.amount-no-currency', compact('classes', 'name', 'label', 'value', 'options'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Could not render amountNoCurrency(): %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('Could not render amountNoCurrency(): %s', $e->getMessage()));
|
||||
$html = 'Could not render amountNoCurrency.';
|
||||
throw new FireflyException($html, 0, $e);
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ class ExportDataGenerator
|
||||
try {
|
||||
$string = $csv->toString();
|
||||
} catch (Exception $e) { // intentional generic exception
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
throw new FireflyException(sprintf(self::EXPORT_ERR, $e->getMessage()), 0, $e);
|
||||
}
|
||||
|
||||
@ -289,7 +289,7 @@ class ExportDataGenerator
|
||||
try {
|
||||
$string = $csv->toString();
|
||||
} catch (Exception $e) { // intentional generic exception
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
throw new FireflyException(sprintf(self::EXPORT_ERR, $e->getMessage()), 0, $e);
|
||||
}
|
||||
|
||||
@ -356,7 +356,7 @@ class ExportDataGenerator
|
||||
try {
|
||||
$string = $csv->toString();
|
||||
} catch (Exception $e) { // intentional generic exception
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
throw new FireflyException(sprintf(self::EXPORT_ERR, $e->getMessage()), 0, $e);
|
||||
}
|
||||
|
||||
@ -407,7 +407,7 @@ class ExportDataGenerator
|
||||
try {
|
||||
$string = $csv->toString();
|
||||
} catch (Exception $e) { // intentional generic exception
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
throw new FireflyException(sprintf(self::EXPORT_ERR, $e->getMessage()), 0, $e);
|
||||
}
|
||||
|
||||
@ -487,7 +487,7 @@ class ExportDataGenerator
|
||||
try {
|
||||
$string = $csv->toString();
|
||||
} catch (Exception $e) { // intentional generic exception
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
throw new FireflyException(sprintf(self::EXPORT_ERR, $e->getMessage()), 0, $e);
|
||||
}
|
||||
|
||||
@ -651,7 +651,7 @@ class ExportDataGenerator
|
||||
try {
|
||||
$string = $csv->toString();
|
||||
} catch (Exception $e) { // intentional generic exception
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
throw new FireflyException(sprintf(self::EXPORT_ERR, $e->getMessage()), 0, $e);
|
||||
}
|
||||
|
||||
@ -782,7 +782,7 @@ class ExportDataGenerator
|
||||
try {
|
||||
$string = $csv->toString();
|
||||
} catch (Exception $e) { // intentional generic exception
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
throw new FireflyException(sprintf(self::EXPORT_ERR, $e->getMessage()), 0, $e);
|
||||
}
|
||||
|
||||
@ -837,7 +837,7 @@ class ExportDataGenerator
|
||||
try {
|
||||
$string = $csv->toString();
|
||||
} catch (Exception $e) { // intentional generic exception
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
throw new FireflyException(sprintf(self::EXPORT_ERR, $e->getMessage()), 0, $e);
|
||||
}
|
||||
|
||||
@ -990,7 +990,7 @@ class ExportDataGenerator
|
||||
try {
|
||||
$string = $csv->toString();
|
||||
} catch (Exception $e) { // intentional generic exception
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
throw new FireflyException(sprintf(self::EXPORT_ERR, $e->getMessage()), 0, $e);
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ class FireflyConfig
|
||||
try {
|
||||
$config = Configuration::whereName($name)->whereNull('deleted_at')->first();
|
||||
} catch (QueryException $e) {
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
$item = new Configuration();
|
||||
$item->name = $name;
|
||||
$item->data = $value;
|
||||
|
@ -158,7 +158,7 @@ trait FormSupport
|
||||
try {
|
||||
$date = today(config('app.timezone'));
|
||||
} catch (InvalidDateException $e) {
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
}
|
||||
|
||||
return $date;
|
||||
|
@ -60,8 +60,8 @@ trait ModelInformation
|
||||
]
|
||||
)->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Throwable was thrown in getActionsForBill(): %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Throwable was thrown in getActionsForBill(): %s', $e->getMessage()));
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$result = 'Could not render view. See log files.';
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ trait RenderPartialViews
|
||||
try {
|
||||
$view = view('popup.report.balance-amount', compact('journals', 'budget', 'account'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Could not render: %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('Could not render: %s', $e->getMessage()));
|
||||
$view = 'Firefly III could not render the view. Please see the log files.';
|
||||
throw new FireflyException($view, 0, $e);
|
||||
}
|
||||
@ -93,7 +93,7 @@ trait RenderPartialViews
|
||||
try {
|
||||
$result = view('reports.options.budget', compact('budgets'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Cannot render reports.options.tag: %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('Cannot render reports.options.tag: %s', $e->getMessage()));
|
||||
$result = 'Could not render view.';
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
@ -126,7 +126,7 @@ trait RenderPartialViews
|
||||
try {
|
||||
$view = view('popup.report.budget-spent-amount', compact('journals', 'budget'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Could not render: %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('Could not render: %s', $e->getMessage()));
|
||||
$view = 'Firefly III could not render the view. Please see the log files.';
|
||||
throw new FireflyException($view, 0, $e);
|
||||
}
|
||||
@ -155,7 +155,7 @@ trait RenderPartialViews
|
||||
try {
|
||||
$view = view('popup.report.category-entry', compact('journals', 'category'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Could not render: %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('Could not render: %s', $e->getMessage()));
|
||||
$view = 'Firefly III could not render the view. Please see the log files.';
|
||||
throw new FireflyException($view, 0, $e);
|
||||
}
|
||||
@ -178,7 +178,7 @@ trait RenderPartialViews
|
||||
try {
|
||||
$result = view('reports.options.category', compact('categories'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Cannot render reports.options.category: %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('Cannot render reports.options.category: %s', $e->getMessage()));
|
||||
$result = 'Could not render view.';
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
@ -221,7 +221,7 @@ trait RenderPartialViews
|
||||
try {
|
||||
$result = view('reports.options.double', compact('set'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Cannot render reports.options.tag: %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('Cannot render reports.options.tag: %s', $e->getMessage()));
|
||||
$result = 'Could not render view.';
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
@ -256,7 +256,7 @@ trait RenderPartialViews
|
||||
try {
|
||||
$view = view('popup.report.expense-entry', compact('journals', 'account'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Could not render: %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('Could not render: %s', $e->getMessage()));
|
||||
$view = 'Firefly III could not render the view. Please see the log files.';
|
||||
throw new FireflyException($view, 0, $e);
|
||||
}
|
||||
@ -293,7 +293,7 @@ trait RenderPartialViews
|
||||
)->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::debug(sprintf('Throwable was thrown in getCurrentActions(): %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
throw new FireflyException(sprintf('Could not render: %s', $e->getMessage()), 0, $e);
|
||||
}
|
||||
|
||||
@ -348,7 +348,7 @@ trait RenderPartialViews
|
||||
)->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::debug(sprintf('Throwable was thrown in getCurrentTriggers(): %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
throw new FireflyException(sprintf('Could not render: %s', $e->getMessage()), 0, $e);
|
||||
}
|
||||
|
||||
@ -385,7 +385,7 @@ trait RenderPartialViews
|
||||
try {
|
||||
$view = view('popup.report.income-entry', compact('journals', 'account'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Could not render: %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('Could not render: %s', $e->getMessage()));
|
||||
$view = 'Firefly III could not render the view. Please see the log files.';
|
||||
throw new FireflyException($view, 0, $e);
|
||||
}
|
||||
@ -404,7 +404,7 @@ trait RenderPartialViews
|
||||
try {
|
||||
$result = view('reports.options.no-options')->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Cannot render reports.options.no-options: %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('Cannot render reports.options.no-options: %s', $e->getMessage()));
|
||||
$result = 'Could not render view.';
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
@ -428,7 +428,7 @@ trait RenderPartialViews
|
||||
try {
|
||||
$result = view('reports.options.tag', compact('tags'))->render();
|
||||
} catch (Throwable $e) {
|
||||
Log::error(sprintf('Cannot render reports.options.tag: %s', $e->getMessage()));
|
||||
app('log')->error(sprintf('Cannot render reports.options.tag: %s', $e->getMessage()));
|
||||
$result = 'Could not render view.';
|
||||
throw new FireflyException($result, 0, $e);
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user