Skip to content

Commit

Permalink
Removed the use of FailLog class
Browse files Browse the repository at this point in the history
Signed-off-by: hudecsamuel <[email protected]>
  • Loading branch information
hudecsamuel committed Jun 15, 2016
1 parent 93a1919 commit f67f767
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
6 changes: 0 additions & 6 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace App\Console;

use App\FailLog;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

Expand All @@ -28,10 +27,5 @@ protected function schedule(Schedule $schedule)
$schedule->command('inspire')
->hourly();

$schedule->call(function(){
FailLog::create([
"message" => "This is from schedule!"
]);
})->everyMinute();
}
}
12 changes: 2 additions & 10 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Exceptions;

use App\Auth;
use App\FailLog;
use Exception;
use GuzzleHttp\Exception\ClientException;
use Illuminate\Auth\Access\AuthorizationException;
Expand Down Expand Up @@ -55,15 +54,6 @@ public function report(Exception $e)
public function render($request, Exception $e)
{

if (app()->environment() != 'production') {
FailLog::create([
'message' => $e->getMessage() . ", Exception: " . get_class($e) .
"\nIn file: " . $e->getFile() . " on line: " . $e->getLine() .
" Stack trace: \n" . $e->getTraceAsString(),
"request" => $request->path()
]);
}

$isWidget = preg_match("/\b^widget\b/", $request->path());

if ($isWidget) {
Expand All @@ -83,6 +73,8 @@ public function render($request, Exception $e)
return redirect()->route('404');
} elseif ($e instanceof FatalThrowableError) {
return redirect()->route('error', ['message' => trans('error.authorization')]);
} elseif ($e instanceof AuthorizationException) {
return redirect()->route('error', ['message' => $e->getMessage()]);
}

if (app()->environment() == 'production') {
Expand Down

0 comments on commit f67f767

Please sign in to comment.