Skip to content

[Feature]: weave.op API should expose parameter to decode function status from function return value, instead of relying on uncaught exceptions #5747

@awgr-zyphra

Description

@awgr-zyphra

Description

all functions that return without exception set a green check status in the weave trace UI
a typical case is code (especially legacy code) which expresses failure as a state rather than raising an exception

Suggested Solution

providing a simple interface on weave.op(status_decoder=f) for a parameter which is approximately f: ResultType → bool is sufficient to enable control of statuses by output data.

to permit more variance, the UI could be updated to support other symbols (other than green check or red x), i.e. the set of emoji, and users could provide f:ResultType → int, where int is a natural number indexing the set of emoji, or even an emoji directly as a string value.

Weave Project Link

No response

Screenshots or Mockups

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions