Skip to content

Tween exception stack traces are not clickable #119

@noio

Description

@noio

When an error occurs during a tween callback (such as when setting the value through from a Custom tween, or calling an onComplete), PrimeTween helpfully shows the stack trace up to that point, but it is not clickable.

And the log can be really dense.

Screenshot 2024-10-16 at 13 43 55

I think a simple Debug.LogException(e) should do it! It will then give the full stack trace of the code that caused the exception.

Somewhere in these lines:

try {
    _onValueChange(_target, val);
} catch (Exception e) {
    Assert.LogError($"Tween was stopped because of exception in {nameof(onValueChange)} callback, tween: {_tween.GetDescription()}, exception:\n{e}\n", _tween.id, _tween.target as UnityEngine.Object);
    _tween.EmergencyStop();
}

Note that I'm not talking about the "creation stack trace", which is also very handy! But honestly most of the time I just want to click into the valueChanged / onTweenComplete callback code that caused the exception in the first place.

Screenshot 2024-10-16 at 13 52 52

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions