本文整理汇总了PHP中Laravel\Lumen\Exceptions\Handler::report方法的典型用法代码示例。如果您正苦于以下问题:PHP Handler::report方法的具体用法?PHP Handler::report怎么用?PHP Handler::report使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Laravel\Lumen\Exceptions\Handler
的用法示例。
在下文中一共展示了Handler::report方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getReporter
/**
* @return mixed
*/
public function getReporter() : callable
{
$default = function (Exception $e) {
parent::report($e);
};
return $this->reporter ?: $default;
}
示例2: report
/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @return void
*/
public function report(Exception $e)
{
if ($e instanceof MethodNotAllowedHttpException) {
$request = app('request');
debug_log(get_class($e), $request->method() . ' ' . $request->fullUrl());
}
return parent::report($e);
}
示例3: report
/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @return void
*/
public function report(Exception $e)
{
foreach ($this->dontReport as $type) {
if ($e instanceof $type) {
parent::report($e);
}
}
$bugsnag = app('bugsnag');
if ($bugsnag) {
$bugsnag->notifyException($e, null, "error");
}
parent::report($e);
}
示例4: report
/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @return void
*/
public function report(Exception $e)
{
foreach ($this->dontReport as $type) {
if ($e instanceof $type) {
return parent::report($e);
}
}
// TODO: integrate laravel service provider to work with lumen
if ($this->app->bound('cask')) {
$this->app->cask->reportException($e);
}
return parent::report($e);
}
示例5: report
public function report(Exception $e)
{
if (env('APP_ENV') != 'local') {
try {
$bugsnag = app('bugsnag');
if ($bugsnag) {
$bugsnag->notifyException($e, null, "error");
}
} catch (Exception $e) {
return $e->getMessage();
}
}
return parent::report($e);
}
示例6: report
/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @return void
*/
public function report(Exception $e)
{
if ($e instanceof ClickatellSendingException) {
Log::error(ClickatellSendingException::class . ": " . $e->getMessage() . " (code:{$e->getCode()})");
if (env('APP_ENV') !== 'testing') {
$options = array('username' => 'legit-bot', 'icon_emoji' => ':mushroom:', 'channel' => '#legit');
$bot = new Slackbot(env('SLACK_WEBHOOK_URL'), $options);
$attachment = $bot->buildAttachment("Legit Error")->setPretext("Something went wrong trying to send an SMS with Legit")->setText(ClickatellSendingException::class . ": " . $e->getMessage() . " (code:{$e->getCode()})")->setColor("red");
$bot->attach($attachment)->send();
return;
}
}
parent::report($e);
}
示例7: report
/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @return void
*/
public function report(Exception $e)
{
parent::report($e);
}
示例8: report
/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @return void
*/
public function report(\Exception $e)
{
return parent::report($e);
}
示例9: report
/**
* Code / Idea from BugSnag
*/
public function report(Exception $e)
{
$data = ['title' => 'Application Exception Error', 'message' => sprintf("Error Filename %s \n on line %d \n with message %s \n with Code %s", $e->getFile(), $e->getLine(), $e->getMessage(), $e->getCode())];
Incomings::send($data);
return parent::report($e);
}
示例10: report
/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @return void
*/
public function report(Exception $e)
{
app('bugsnag')->notifyException($e, []);
return parent::report($e);
}