Skip to content

Commit 4501710

Browse files
Fix lsl_cpp.h exception handling (#194)
* Fixed bug #187 in netinterfaces.cpp * Fix lsl_cpp.h exception handling For error code lsl_lost_error, check_error() shall throw lost_error rather than timeout_error.
1 parent a6f3175 commit 4501710

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/lsl_cpp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1705,7 +1705,7 @@ inline int32_t check_error(int32_t ec) {
17051705
switch (ec) {
17061706
case lsl_timeout_error: throw timeout_error("The operation has timed out.");
17071707
case lsl_lost_error:
1708-
throw timeout_error(
1708+
throw lost_error(
17091709
"The stream has been lost; to continue reading, you need to re-resolve it.");
17101710
case lsl_argument_error:
17111711
throw std::invalid_argument("An argument was incorrectly specified.");

src/netinterfaces.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ std::vector<lsl::netif> lsl::get_local_interfaces() {
8787
// No address? Skip.
8888
if (addr->ifa_addr == nullptr) continue;
8989
LOG_F(INFO, "netif '%s' (status: %d, multicast: %d, broadcast: %d)", addr->ifa_name,
90-
addr->ifa_flags & IFF_MULTICAST, addr->ifa_flags & IFF_UP,
90+
addr->ifa_flags & IFF_UP, addr->ifa_flags & IFF_MULTICAST,
9191
addr->ifa_flags & IFF_BROADCAST);
9292
// Interface doesn't support multicast? Skip.
9393
if (!(addr->ifa_flags & IFF_MULTICAST)) continue;

0 commit comments

Comments
 (0)