kixelated / moq-rs

Rust library for Media over QUIC
Apache License 2.0
385 stars 56 forks source link

Better error codes #101

Open kixelated opened 10 months ago

kixelated commented 10 months ago

If you use moq-pub with a duplicate broadcast, you'll get an error:

Error: failed to create MoQ Transport session

Caused by:
    0: decode error: io error: connection lost
    1: io error: connection lost
    2: connection lost
    3: closed by peer: 91141958511331

A few issues here:

  1. The error code is not being converted from the WebTransport number space back to the application number space. 91141958511331 = 409 or something
  2. We should have a 1:1 mapping between error codes so we can display the human-readable text. In this case, duplicate.
  3. Or errors have an optional "reason" so we should display that instead.