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

Have Error::Disconnected contain the actor name #146

Open
thomaseizinger opened this issue Jul 18, 2022 · 8 comments
Open

Have Error::Disconnected contain the actor name #146

thomaseizinger opened this issue Jul 18, 2022 · 8 comments
Milestone

Comments

@thomaseizinger
Copy link
Collaborator

Makes for better error messages.

@Restioson
Copy link
Owner

I think that all the errors should probably contain actor name and message type where possible, too. This would mean having something like

struct Error {
    actor: Option<&'static str>,
    message: Option<&'static str>,
    kind: ErrorKind,
}

enum ErrorKind {
    Interrupted,
    Disconnected,
}

actor would be nullable since a disconnected message channel wouldn't know the actor type.

@Restioson
Copy link
Owner

Related: is it worth making Error<M> and have the error return the message if the send itself fails early with Disconnected? This could be an inconvenience, but is a standard channel API thing.

@thomaseizinger
Copy link
Collaborator Author

actor would be nullable since a disconnected message channel wouldn't know the actor type.

A message channel knows which actor it is targeting so I think this should still be possible?

@Restioson
Copy link
Owner

Ah, that is true!

@thomaseizinger
Copy link
Collaborator Author

This will also be a breaking change so I think we should try and get it into 0.6.

@thomaseizinger thomaseizinger added this to the 0.6.0 milestone Jul 26, 2022
@thomaseizinger
Copy link
Collaborator Author

I am not sure I will have time to work on this any time soon. I don' think it is a must to get into 0.6 and current master is so much better than 0.5 that I think we should release it.

What do you think?

@Restioson
Copy link
Owner

I agree! Can definitely postpone this.

@Restioson Restioson modified the milestones: 0.6.0, 0.7.0 Jan 31, 2023
@thomaseizinger
Copy link
Collaborator Author

Perhaps we should at least make the struct opaque such that we can work on this feature without making a breaking change?

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

2 participants