Skip to content

Commit

Permalink
Log errors before returing missing sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
tbuteler committed Oct 27, 2016
1 parent c66eab1 commit ad25e65
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions readme.md
Expand Up @@ -5,12 +5,12 @@ Simple sitemaps for Laravel projects

## Installing

- Use Composer to install:
Use Composer to install:
```
composer require clumsy/sitemap
```

- In the `config/app.php` file, add this to the `providers` key:
In the `config/app.php` file, add this to the `providers` key:
```php
Clumsy\Sitemap\SitemapServiceProvider::class,
```
Expand Down
9 changes: 7 additions & 2 deletions src/Controller.php
Expand Up @@ -3,17 +3,21 @@
namespace Clumsy\Sitemap;

use ArrayAccess;
use Illuminate\Foundation\Application;
use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
{
protected $sitemap;

protected $app;

protected $groups;

public function __construct()
public function __construct(Application $app)
{
$this->sitemap = new Sitemap;
$this->app = $app;
}

protected function missing()
Expand Down Expand Up @@ -77,7 +81,8 @@ public function render()
$this->groups = include $path;

} catch (\Exception $e) {

// Log the exception before returning a 404
$this->app->log->error($e);
return $this->missing();
}

Expand Down

0 comments on commit ad25e65

Please sign in to comment.