mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Merge pull request #15592 from spencerrlongg/bug/catch_request_notify_errors
Catch Errors Around Request Notifications
This commit is contained in:
commit
45ab49eeab
|
@ -240,7 +240,7 @@ class AcceptanceController extends Controller
|
||||||
try {
|
try {
|
||||||
$acceptance->notify(new AcceptanceAssetAcceptedNotification($data));
|
$acceptance->notify(new AcceptanceAssetAcceptedNotification($data));
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
Log::error($e);
|
Log::warning($e);
|
||||||
}
|
}
|
||||||
event(new CheckoutAccepted($acceptance));
|
event(new CheckoutAccepted($acceptance));
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ use App\Notifications\RequestAssetNotification;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
use \Illuminate\Contracts\View\View;
|
use \Illuminate\Contracts\View\View;
|
||||||
|
use Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This controller handles all actions related to the ability for users
|
* This controller handles all actions related to the ability for users
|
||||||
|
@ -179,8 +180,11 @@ class ViewAssetsController extends Controller
|
||||||
$asset->decrement('requests_counter', 1);
|
$asset->decrement('requests_counter', 1);
|
||||||
|
|
||||||
$logaction->logaction('request canceled');
|
$logaction->logaction('request canceled');
|
||||||
|
try {
|
||||||
$settings->notify(new RequestAssetCancelation($data));
|
$settings->notify(new RequestAssetCancelation($data));
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Log::warning($e);
|
||||||
|
}
|
||||||
return redirect()->route('requestable-assets')
|
return redirect()->route('requestable-assets')
|
||||||
->with('success')->with('success', trans('admin/hardware/message.requests.canceled'));
|
->with('success')->with('success', trans('admin/hardware/message.requests.canceled'));
|
||||||
}
|
}
|
||||||
|
@ -188,7 +192,11 @@ class ViewAssetsController extends Controller
|
||||||
$logaction->logaction('requested');
|
$logaction->logaction('requested');
|
||||||
$asset->request();
|
$asset->request();
|
||||||
$asset->increment('requests_counter', 1);
|
$asset->increment('requests_counter', 1);
|
||||||
|
try {
|
||||||
$settings->notify(new RequestAssetNotification($data));
|
$settings->notify(new RequestAssetNotification($data));
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Log::warning($e);
|
||||||
|
}
|
||||||
|
|
||||||
return redirect()->route('requestable-assets')->with('success')->with('success', trans('admin/hardware/message.requests.success'));
|
return redirect()->route('requestable-assets')->with('success')->with('success', trans('admin/hardware/message.requests.success'));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue