mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Re-throw exceptions if we're in CI (#14890)
Else they are not shown during tests
This commit is contained in:
@@ -157,6 +157,11 @@ function discover_device(&$device, $force_module = false)
|
||||
Log::error("%rError discovering $module module for {$device['hostname']}.%n $e", ['color' => true]);
|
||||
\App\Models\Eventlog::log("Error discovering $module module. Check log file for more details.", $device['device_id'], 'discovery', Alert::ERROR);
|
||||
report($e);
|
||||
|
||||
// Re-throw exception if we're in CI
|
||||
if (getenv('CI') == true) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
$module_time = microtime(true) - $module_start;
|
||||
|
@@ -342,6 +342,11 @@ function poll_device($device, $force_module = false)
|
||||
Log::error("%rError polling $module module for {$device['hostname']}.%n $e", ['color' => true]);
|
||||
\App\Models\Eventlog::log("Error polling $module module. Check log file for more details.", $device['device_id'], 'poller', Alert::ERROR);
|
||||
report($e);
|
||||
|
||||
// Re-throw exception if we're in CI
|
||||
if (getenv('CI') == true) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
$module_time = microtime(true) - $module_start;
|
||||
|
Reference in New Issue
Block a user