Skip to content

Override ToString in Builder classes #86

@tomkail

Description

@tomkail

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions