Skip to content

Commit

Permalink
Merge pull request #1264 from paullouisageneau/reword-send-exceptions
Browse files Browse the repository at this point in the history
Reword send exceptions for clarity
  • Loading branch information
paullouisageneau authored Oct 1, 2024
2 parents 4bf08fd + 99fca9a commit c1c63ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/impl/datachannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,12 @@ bool DataChannel::outgoing(message_ptr message) {
std::shared_lock lock(mMutex);
transport = mSctpTransport.lock();

if (!transport || mIsClosed)
if (mIsClosed)
throw std::runtime_error("DataChannel is closed");

if (!transport)
throw std::runtime_error("DataChannel not open");

if (!mStream.has_value())
throw std::logic_error("DataChannel has no stream assigned");

Expand Down
2 changes: 1 addition & 1 deletion src/impl/track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ bool Track::transportSend([[maybe_unused]] message_ptr message) {
std::shared_lock lock(mMutex);
transport = mDtlsSrtpTransport.lock();
if (!transport)
throw std::runtime_error("Track is closed");
throw std::runtime_error("Track is not open");

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

0 comments on commit c1c63ae

Please sign in to comment.