Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose error definitions #251

Closed
at-wat opened this issue Nov 22, 2022 · 6 comments
Closed

Expose error definitions #251

at-wat opened this issue Nov 22, 2022 · 6 comments

Comments

@at-wat
Copy link
Member

at-wat commented Nov 22, 2022

webrtc.DataChannel.OnError(err error) often receives

  • abort chunk, with following errors: (User Initiated Abort: Close called).
  • sending reset packet in non-established state: state=Closed

which seems be intended results. (Maybe by the recent updates?)

Possible solutions

  • Expose base errors (var errErrorName -> var ErrErrorName) for errors.Is()
  • Define struct for errors with values for errors.As()
    e.g. errChunk,
    type ErrChunk struct {
      Name string
      Causes []string
    }
    func (e *ErrChunk) Error() {
      var errStr string
      for _, e := range e.Causes {
        errStr += fmt.Sprintf("(%s)", e)
      }
      return fmt.Sprintf("[%s] abort chunk, with following errors: %s", e.Name, errStr)
    }
@at-wat
Copy link
Member Author

at-wat commented Nov 24, 2022

webrtc.DataChannel.OnError(err error) often receives

  • abort chunk, with following errors: (User Initiated Abort: Close called).
  • sending reset packet in non-established state: state=Closed

which seems be intended results. (Maybe by the recent updates?)

#183 seems related

@edaniels
Copy link
Member

We're seeing these errors (specifically sending reset packet in non-established state plenty of the time now and are logging them as such. Is there a way to quiet these if they are normal operating errors?

@at-wat
Copy link
Member Author

at-wat commented Jan 13, 2023

@jeremija any idea about above error?

@jeremija
Copy link
Member

jeremija commented Jan 13, 2023

This is most likely as side effect of #183

I'm not sure if we should skip the callback or expose the errors, but exposing the errors makes sense to me as it's a smaller change (easier to reason about).

@at-wat
Copy link
Member Author

at-wat commented Jan 13, 2023

Released v1.8.6

@at-wat
Copy link
Member Author

at-wat commented Jan 16, 2023

Using exposed errors in my product works as expected now

@at-wat at-wat closed this as completed Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants