mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Merge pull request #16175 from Godmartinz/channel-not-found-warning-added
This commit is contained in:
commit
39ce7b75ca
|
@ -106,7 +106,13 @@ class CheckoutableListener
|
|||
}
|
||||
}
|
||||
} catch (ClientException $e) {
|
||||
Log::error("ClientException caught during checkin notification: " . $e->getMessage());
|
||||
if (strpos($e->getMessage(), 'channel_not_found') !== false) {
|
||||
Log::warning(Setting::getSettings()->webhook_selected." notification failed: " . $e->getMessage());
|
||||
return redirect()->back()->with('warning', ucfirst(Setting::getSettings()->webhook_selected) .trans('admin/settings/message.webhook.webhook_channel_not_found') );
|
||||
}
|
||||
else {
|
||||
Log::error("ClientException caught during checkin notification: " . $e->getMessage());
|
||||
}
|
||||
return redirect()->back()->with('warning', ucfirst(Setting::getSettings()->webhook_selected) .trans('admin/settings/message.webhook.webhook_fail') );
|
||||
} catch (Exception $e) {
|
||||
Log::error(ucfirst(Setting::getSettings()->webhook_selected) . ' webhook notification failed:', [
|
||||
|
@ -196,8 +202,14 @@ class CheckoutableListener
|
|||
}
|
||||
}
|
||||
} catch (ClientException $e) {
|
||||
Log::error("ClientException caught during checkin notification: " . $e->getMessage());
|
||||
return redirect()->back()->with('warning', ucfirst(Setting::getSettings()->webhook_selected) .trans('admin/settings/message.webhook.webhook_fail'));
|
||||
if (strpos($e->getMessage(), 'channel_not_found') !== false) {
|
||||
Log::warning(Setting::getSettings()->webhook_selected." notification failed: " . $e->getMessage());
|
||||
return redirect()->back()->with('warning', ucfirst(Setting::getSettings()->webhook_selected) .trans('admin/settings/message.webhook.webhook_channel_not_found') );
|
||||
}
|
||||
else {
|
||||
Log::error("ClientException caught during checkin notification: " . $e->getMessage());
|
||||
return redirect()->back()->with('warning', ucfirst(Setting::getSettings()->webhook_selected) . trans('admin/settings/message.webhook.webhook_fail'));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
Log::error(ucfirst(Setting::getSettings()->webhook_selected) . ' webhook notification failed:', [
|
||||
'error' => $e->getMessage(),
|
||||
|
|
|
@ -46,5 +46,6 @@ return [
|
|||
'error_redirect' => 'ERROR: 301/302 :endpoint returns a redirect. For security reasons, we don’t follow redirects. Please use the actual endpoint.',
|
||||
'error_misc' => 'Something went wrong. :( ',
|
||||
'webhook_fail' => ' webhook notification failed: Check to make sure the URL is still valid.',
|
||||
'webhook_channel_not_found' => ' webhook channel not found.'
|
||||
]
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue