Skip to content

Commit ca69103

Browse files
committed
Include invalid value in exception information in stream_info constructor
1 parent 3de8dab commit ca69103

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/stream_info_impl.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "stream_info_impl.h"
22
#include "api_config.h"
3+
#include "cast.h"
34
#include <algorithm>
45
#include <boost/thread/lock_guard.hpp>
56
#include <limits>
@@ -8,7 +9,7 @@
89
using namespace lsl;
910
using namespace pugi;
1011
using std::string;
11-
using std::to_string;
12+
using lsl::to_string;
1213

1314
stream_info_impl::stream_info_impl()
1415
: channel_count_(0), nominal_srate_(0), channel_format_(cft_undefined), version_(0),
@@ -29,7 +30,8 @@ stream_info_impl::stream_info_impl(const string &name, const string &type, int c
2930
if (nominal_srate < 0)
3031
throw std::invalid_argument("The nominal sampling rate of a stream must be nonnegative.");
3132
if (channel_format < 0 || channel_format > 7)
32-
throw std::invalid_argument("The stream info was created with an unknown channel format.");
33+
throw std::invalid_argument("The stream info was created with an unknown channel format " +
34+
to_string(static_cast<int>(channel_format)));
3335
// initialize XML document
3436
write_xml(doc_);
3537
}

0 commit comments

Comments
 (0)