Skip to content
This repository has been archived by the owner on Apr 7, 2019. It is now read-only.

Commit

Permalink
Merge pull request #9 from AltThree/report
Browse files Browse the repository at this point in the history
Report issues instead of crashing
  • Loading branch information
GrahamCampbell committed Aug 14, 2015
2 parents f0d2783 + 5f68319 commit 92f01cb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ An emoji parser for Laravel 5.
To get the latest version of Alt Three Emoji, simply add the following line to the require block of your `composer.json` file:

```
"alt-three/emoji": "~1.1"
"alt-three/emoji": "~1.2"
```

You'll then need to run `composer install` or `composer update` to download it and have the autoloader updated.
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"php": ">=5.5.9",
"graham-campbell/markdown": "~4.0",
"guzzlehttp/guzzle": "~5.3|~6.0",
"illuminate/contracts": "5.1.*",
"illuminate/support": "5.1.*"
},
"require-dev": {
Expand All @@ -42,7 +43,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
"dev-master": "1.2-dev"
}
},
"minimum-stability": "dev",
Expand Down
9 changes: 8 additions & 1 deletion src/EmojiServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

namespace AltThree\Emoji;

use Exception;
use GuzzleHttp\Client;
use Illuminate\Contracts\Debug\ExceptionHandler;
use Illuminate\Support\ServiceProvider;
use League\CommonMark\Environment;

Expand Down Expand Up @@ -88,7 +90,12 @@ protected function registerEnvironment()
$app = $this->app;

$app->resolving('markdown.environment', function (Environment $environment) use ($app) {
$environment->addInlineParser($app['emoji']);
try {
$environment->addInlineParser($app['emoji']);
} catch (Exception $e) {
$app->make(ExceptionHandler::class)->report($e);
}

});
}

Expand Down

0 comments on commit 92f01cb

Please # to comment.