-
Notifications
You must be signed in to change notification settings - Fork 633
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
Implement common SinkError and SinkResult #820
Implement common SinkError and SinkResult #820
Conversation
* Add more errors. * impl From<AlsaError> for io::Error so AlsaErrors can be thrown to player as io::Errors. This little bit of boilerplate goes a long way to simplifying things further down in the code. And will make any needed future changes easier. * A little code clean up and added blank lines to make it easier to read at a glance.
While I like this direction, I would prefer to not throw as |
You're talking about changing the return type in mod. That would instantly break every backend. That would mean I would have to fix all of the backends at once basically. That's not really something I want to do,lol!!! I kinda like the idea of keeping From a possible regression/error standpoint I also think it would be better to make each backend fix a separate PR. It also makes for smaller jobs and easier to review code. |
When all of the backends are eventually fixed by hopefully other people who actually use and care about them I volunteer to implement |
I'll think about it. I don't think changing it in all the backends would be that much work (as long as you keep further error improvements separate). |
There. You were right, it wasn't that bad. For the most part since most of the backends just unwrap and explode instead of actually throwing errors it was mostly just a matter of changing the return type on functions they override. I'm not married to the error names or strings. I was just trying to keep it simple. I'm open to any and all suggestions. |
@roderickvd on an unrelated note I put in a PR to the alsa bindings so hopefully we can stop worrying about endianness in our ALSA backend. Not that it's a huge concern but still. |
I see they were already merged upstream, great! |
Yep so I guess when the next version is released we can use |
@roderickvd I think this about ready for a review when you get a chance. |
Shall we do #823 first? |
Sure. You've already started the review process. No matter the order I will need do a little bit of tweaking on the one that gets merged 2nd anyway. I tried to make them contained as possible but it was inevitable that there would be a little bit of bleed though. |
Alright, last one! |
There's a little bit of work to be done in resolving the conflicts beyond what github would have you believe. I'll give it a go after work over the next day or 2. |
If all goes well that should do it as far as fixing the conflicts. |
Ok @roderickvd I think this is done for real this time 😃 That last one was just a bonus. 😆 |
Great! I'll check it out and I think we have a |
Working fine for me so far ❤️ let's merge this, give it a bit of exposure and ping @sashahilton00 for a release somewhere the coming weekends? |
Implement common
SinkError
andSinkResult
for use with all backends.impl From<AlsaError> for SinkError
soAlsaError
s can be thrown toplayer
asSinkError
s.impl From<PulseError> for PulseError
soPulseError
s can be thrown toplayer
asSinkError
s.Other backends can follow the same pattern as the alsa and pulseaudio backends for detailed errors in the future if someone wishes to implement them.
A little code clean up and added blank lines to make it easier to read at a glance.