mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-30 00:00:11 +01:00
Use villas exception
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
This commit is contained in:
parent
eeb56f47ae
commit
1f19e42416
1 changed files with 4 additions and 3 deletions
|
@ -10,15 +10,16 @@
|
|||
#include <regex>
|
||||
#include <stdexcept>
|
||||
|
||||
#include <villas/exceptions.hpp>
|
||||
#include <villas/kernel/devices/ip_device.hpp>
|
||||
|
||||
using villas::kernel::devices::IpDevice;
|
||||
|
||||
IpDevice IpDevice::from(const std::filesystem::path unsafe_path) {
|
||||
if (!is_path_valid(unsafe_path))
|
||||
throw std::runtime_error(
|
||||
"Path \"" + unsafe_path.u8string() +
|
||||
"\" failed validation as IpDevicePath \"[adress in hex].[name]\". ");
|
||||
throw RuntimeError(
|
||||
"Path {} failed validation as IpDevicePath [adress in hex].[name] ",
|
||||
unsafe_path.u8string());
|
||||
return IpDevice(unsafe_path);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue