mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 05:04:07 -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 {
|
||||
$acceptance->notify(new AcceptanceAssetAcceptedNotification($data));
|
||||
} catch (\Exception $e) {
|
||||
Log::error($e);
|
||||
Log::warning($e);
|
||||
}
|
||||
event(new CheckoutAccepted($acceptance));
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ use App\Notifications\RequestAssetNotification;
|
|||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use \Illuminate\Contracts\View\View;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* This controller handles all actions related to the ability for users
|
||||
|
@ -179,8 +180,11 @@ class ViewAssetsController extends Controller
|
|||
$asset->decrement('requests_counter', 1);
|
||||
|
||||
$logaction->logaction('request canceled');
|
||||
$settings->notify(new RequestAssetCancelation($data));
|
||||
|
||||
try {
|
||||
$settings->notify(new RequestAssetCancelation($data));
|
||||
} catch (\Exception $e) {
|
||||
Log::warning($e);
|
||||
}
|
||||
return redirect()->route('requestable-assets')
|
||||
->with('success')->with('success', trans('admin/hardware/message.requests.canceled'));
|
||||
}
|
||||
|
@ -188,7 +192,11 @@ class ViewAssetsController extends Controller
|
|||
$logaction->logaction('requested');
|
||||
$asset->request();
|
||||
$asset->increment('requests_counter', 1);
|
||||
$settings->notify(new RequestAssetNotification($data));
|
||||
try {
|
||||
$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'));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue