From 978c6040f8125874611b9b9823ee4f222f52b156 Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Fri, 17 May 2019 21:24:23 -0500 Subject: [PATCH] modified log and warning messages for exceptions. --- app/Console/Commands/holdingfinances.php | 2 ++ app/Jobs/ProcessWalletJournalJob.php | 2 +- app/Jobs/ProcessWallettransactionJob.php | 2 +- app/Jobs/SendEveMailJob.php | 3 ++- app/Library/Finances/Helper/FinanceHelper.php | 15 ++++++++++----- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/app/Console/Commands/holdingfinances.php b/app/Console/Commands/holdingfinances.php index 13d7bbda7..c7a56f239 100644 --- a/app/Console/Commands/holdingfinances.php +++ b/app/Console/Commands/holdingfinances.php @@ -3,6 +3,7 @@ namespace App\Console\Commands; use Illuminate\Console\Command; +use Log; use Commands\Library\CommandHelper; use App\Library\Finances\Helper\FinanceHelper; @@ -65,6 +66,7 @@ class HoldingFinancesCommand extends Command $job->charId = 93738489; $job->page = $i; ProcessWalletJournalJob::dispatch($job)->onQueue('journal'); + Log::info('Process Wallet Journal Job dispatched.'); } //Mark the job as finished diff --git a/app/Jobs/ProcessWalletJournalJob.php b/app/Jobs/ProcessWalletJournalJob.php index 08ebe1f50..cea8df613 100644 --- a/app/Jobs/ProcessWalletJournalJob.php +++ b/app/Jobs/ProcessWalletJournalJob.php @@ -75,6 +75,6 @@ class ProcessWalletJournalJob implements ShouldQueue */ public function failed($exception) { - dd($exception); + Log::critical($exception); } } diff --git a/app/Jobs/ProcessWallettransactionJob.php b/app/Jobs/ProcessWallettransactionJob.php index 978a9619c..134c8d43c 100644 --- a/app/Jobs/ProcessWallettransactionJob.php +++ b/app/Jobs/ProcessWallettransactionJob.php @@ -71,6 +71,6 @@ class ProcessWalletTransactionJob implements ShouldQueue * @return void */ public function failed($exception) { - dd($exception); + Log::critical($exception); } } diff --git a/app/Jobs/SendEveMailJob.php b/app/Jobs/SendEveMailJob.php index c2883ae66..e11f30759 100644 --- a/app/Jobs/SendEveMailJob.php +++ b/app/Jobs/SendEveMailJob.php @@ -98,6 +98,7 @@ class SendEveMailJob implements ShouldQueue 'character_id'=> 93738489, ]); } catch(RequestFailedException $e) { + Log::warning($e); return null; } @@ -112,6 +113,6 @@ class SendEveMailJob implements ShouldQueue */ public function failed($exception) { - dd($exception); + Log::critical($exception); } } diff --git a/app/Library/Finances/Helper/FinanceHelper.php b/app/Library/Finances/Helper/FinanceHelper.php index a312acb50..b98aa2959 100644 --- a/app/Library/Finances/Helper/FinanceHelper.php +++ b/app/Library/Finances/Helper/FinanceHelper.php @@ -51,7 +51,7 @@ class FinanceHelper { //If the token is not found, send the user an eve mail, and just exit out of the function if($this->TokenNotFound($token, $scope, $charId)) { - printr("Token not found\n"); + Log::info('Token not found. Character Id: ' . $charId); return null; } @@ -76,7 +76,8 @@ class FinanceHelper { 'division' => 3, ]); } catch(RequestFailedException $e) { - return $e->getEsiResponse(); + Log::warning($e->getEsiResponse()); + return null; } //Decode the wallet from json into an array @@ -113,6 +114,7 @@ class FinanceHelper { //If the token is not found, send the user an eve mail, and just exit out of the function if($this->TokenNotFound($token, $scope, $charId)) { + Log::info('Token not found.' . 'Character Id: ' . $charId); return null; } @@ -147,7 +149,8 @@ class FinanceHelper { 'division' => $division, ]); } catch(RequestFailedException $e) { - return $e->getEsiResponse(); + Log::warning($e->getEsiResponse()); + return null; } //Set the total pages we need to cycle through. @@ -216,7 +219,8 @@ class FinanceHelper { 'division' => $division, ]); } catch(RequestFailedException $e) { - return $e->getEsiResponse(); + Log::warning($e->getEsiResponse()); + return null; } $pages = $journals->pages; @@ -265,7 +269,8 @@ class FinanceHelper { 'division' => $division, ]); } catch(RequestFailedException $e) { - return $e->getEsiResponse(); + Log::warning($e->getEsiResponse()); + return null; } //Decode the wallet from json into an array