1
0
Fork 0
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:
Pascal Bauer 2024-09-25 15:40:50 +02:00
parent eeb56f47ae
commit 1f19e42416

View file

@ -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);
}