Catch error when trying to read (non-existent) logs.

This commit is contained in:
James Cole 2018-01-12 21:43:04 +01:00
parent 6799268ec4
commit ce854fbb43
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -25,6 +25,7 @@ namespace FireflyIII\Http\Controllers;
use Carbon\Carbon; use Carbon\Carbon;
use DB; use DB;
use Exception;
use FireflyIII\Http\Middleware\IsDemoUser; use FireflyIII\Http\Middleware\IsDemoUser;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Log; use Log;
@ -84,7 +85,11 @@ class DebugController extends Controller
if ($handler instanceof RotatingFileHandler) { if ($handler instanceof RotatingFileHandler) {
$logFile = $handler->getUrl(); $logFile = $handler->getUrl();
if (null !== $logFile) { if (null !== $logFile) {
$logContent = file_get_contents($logFile); try {
$logContent = file_get_contents('/aaaa/'.$logFile);
} catch(Exception $e) {
// don't care
}
} }
} }
} }