Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #32 from DevlessTeam/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
EDDYMENS committed Aug 22, 2016
2 parents 8dba08e + 5e14181 commit 5c03348
Show file tree
Hide file tree
Showing 72 changed files with 1,780 additions and 1,517 deletions.
4 changes: 0 additions & 4 deletions .idea/blade.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

41 changes: 19 additions & 22 deletions app/Commands/devless.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,25 @@

namespace App\Commands;

use App\Commands\Command;
use Illuminate\Contracts\Bus\SelfHandling;

class devless extends Command implements SelfHandling
{
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
//
}
class devless extends Command implements SelfHandling
{
/**
* Create a new command instance.
*/
public function __construct()
{
//
}

/**
* Execute the command.
*
* @return void
*/
public function handle()
{
//
}
}
/**
* Execute the command.
*
* @return void
*/
public function handle()
{
//
}
}
3 changes: 2 additions & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class Kernel extends ConsoleKernel
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @param \Illuminate\Console\Scheduling\Schedule $schedule
*
* @return void
*/
protected function schedule(Schedule $schedule)
Expand Down
40 changes: 18 additions & 22 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace App\Exceptions;

use Exception;
use App\Helpers\Response as Response;
use Exception;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

class Handler extends ExceptionHandler
{
Expand All @@ -26,45 +26,41 @@ class Handler extends ExceptionHandler
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @param \Exception $e
*
* @return void
*/
public function report(Exception $e)
{

{
return parent::report($e);
}

/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @param \Illuminate\Http\Request $request
* @param \Exception $e
*
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
{
$statusCode = 700;
$payload = [];

if ($e instanceof ModelNotFoundException) {
$e = new NotFoundHttpException($e->getMessage(), $e);
} else if ($e instanceof HttpException) {


if ($e->getTrace()[0]['function'] == 'interrupt') {
$statusCode = $e->getTrace()[0]['args'][0];
}
} elseif ($e instanceof HttpException) {
if ($e->getTrace()[0]['function'] == 'interrupt') {
$statusCode = $e->getTrace()[0]['args'][0];
}
}
$payload = ($statusCode == 700)?
[ 'file' => $e->getFile(), 'line' => $e->getLine()] : [];

$payload = ($statusCode == 700) ?
['file' => $e->getFile(), 'line' => $e->getLine()] : [];

$response = Response::respond($statusCode, $e->getMessage(), $payload);

return response()->json($response);

}
}


Loading

0 comments on commit 5c03348

Please sign in to comment.