Skip to content

Improved warning reporting infrastructure #7841

@PeterJohnson

Description

@PeterJohnson

WPILib generally minimizes the use of exceptions so that user code can continue to operate in a match even in the presence of unexpected inputs. However, this behavior can make it harder for inexperienced users to debug potential issues in their code (such as out-of-range inputs or units errors). We provide telemetry infrastructure to help, but users need to have the knowledge/skills to apply it.

The only other option at present for WPILib classes to report potential user bugs of this kind is by printing a message to the console or using the DS ReportWarning functionality--this is very spammy (as functions can often be called every 20 ms or even multiple times per teleop loop).

It would be helpful to have a way for WPILib classes to report warnings in a way that doesn't crash the program and doesn't spam the console, but rather make that feedback available in another way (ala the "problems" tab in vscode). It would also be good if the warnings could be turned into errors/exceptions at user option for unit tests.

Potentially this could be added into the recently added Alert infrastructure?

Metadata

Metadata

Assignees

No one assigned

    Labels

    20272027 target

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions