Skip to content

Commit c1c63ae

Browse files
Merge pull request #1264 from paullouisageneau/reword-send-exceptions
Reword send exceptions for clarity
2 parents 4bf08fd + 99fca9a commit c1c63ae

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/impl/datachannel.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,12 @@ bool DataChannel::outgoing(message_ptr message) {
185185
std::shared_lock lock(mMutex);
186186
transport = mSctpTransport.lock();
187187

188-
if (!transport || mIsClosed)
188+
if (mIsClosed)
189189
throw std::runtime_error("DataChannel is closed");
190190

191+
if (!transport)
192+
throw std::runtime_error("DataChannel not open");
193+
191194
if (!mStream.has_value())
192195
throw std::logic_error("DataChannel has no stream assigned");
193196

src/impl/track.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ bool Track::transportSend([[maybe_unused]] message_ptr message) {
202202
std::shared_lock lock(mMutex);
203203
transport = mDtlsSrtpTransport.lock();
204204
if (!transport)
205-
throw std::runtime_error("Track is closed");
205+
throw std::runtime_error("Track is not open");
206206

207207
// Set recommended medium-priority DSCP value
208208
// See https://www.rfc-editor.org/rfc/rfc8837.html#section-5

0 commit comments

Comments
 (0)