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

Override ToString in Builder classes #86

Open
tomkail opened this issue Apr 28, 2023 · 1 comment
Open

Override ToString in Builder classes #86

tomkail opened this issue Apr 28, 2023 · 1 comment

Comments

@tomkail
Copy link

tomkail commented Apr 28, 2023

Hey! Got a feature request. We'd find it useful if the various Builder classes (AddMessageActionsBuilder, for example), had a ToString function that returned the various fields that have been set on them.
This is generally useful, but the case we have in mind is more complete error logging when (for example) executing them fails.

Here's what we'd like to be able to do:

addMessageActionsBuilder.Async((result, status) => {
            if (status.Error) {
                Debug.LogError(status.ErrorData.Info+"\n"+addMessageActionsBuilder.ToString());
...

This would tell us that the code failed, and also clearly show us what action was responsible.

This is extra useful when the async code is in an abstracted class, since getting full stack trace for async code can be tricky (esp in Rider when using Async/Await style programming, since it doesn't allow you to track what started the thread it ended on).

In the meantime we're using reflection!

@tomkail
Copy link
Author

tomkail commented Jun 12, 2023

Hello! We've been running into this repeatedly since I first posted this message. Is anyone monitoring this account?

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

1 participant