mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 00:24:21 +02:00
Properly fixed exceptions
This commit is contained in:
@@ -170,7 +170,7 @@ class Client
|
||||
return $driver->query();
|
||||
|
||||
} catch (\Exception $e) {
|
||||
throw new Exception(sprintf('Query has failed, exception: %s', $e->getMessage()));
|
||||
throw new Exception('Query has failed', $e->getCode(), $e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,9 @@ class Database
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
throw new DatabaseException(
|
||||
sprintf('Failed to created database %s, exception: %s', $this->name, $e->getMessage())
|
||||
sprintf('Failed to created database %s', $this->name),
|
||||
$e->getCode(),
|
||||
$e
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -138,7 +140,7 @@ class Database
|
||||
return $driver->isSuccess();
|
||||
|
||||
} catch (\Exception $e) {
|
||||
throw new Exception(sprintf('Writing has failed, exception: %s', $e->getMessage()));
|
||||
throw new Exception('Writing has failed', $e->getCode(), $e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user