FtcRobotController icon indicating copy to clipboard operation
FtcRobotController copied to clipboard

`AnnotatedHooksClassFilter` swallowing exceptions using wrong `RobotLog` method

Open bubner opened this issue 9 months ago • 1 comments

Hi,

The AnnotatedHooksClassFilter class is using RobotLog.e when it should be using RobotLog.ee in order to log an exception caused by one of the SDK app hooks (@OnCreate, @OnDestroy, @OnCreateEventLoop, @WebHandlerRegistrar, etc.)

https://github.com/OpenFTC/Extracted-RC/blob/ce0a67af28c966c7a166ae51765e115a853734fc/FtcCommon/src/main/java/org/firstinspires/ftc/ftccommon/internal/AnnotatedHooksClassFilter.java#L168-L169

Any exceptions thrown during one of these hooks that can be implemented in user code are swallowed and all Logcat reports is the tag, making debugging difficult as it is unclear which hook or method call caused an exception.

Image

This is a minor issue that doesn't concern most FTC programmers but does make post-mortem analysis difficult when paired with libraries that use these hooks.

bubner avatar Mar 16 '25 13:03 bubner

This does look like a valid issue. robotlog.e can't process the exception (none of the method signatures for robotlog.e accept a Throwable parameter) so robotlog.e only logs the tag. robotlog.ee will accept a Throwable parameter and should be called instead. I'll raise an internal issue with the SDK team to look at this in more detail.

acharraggi avatar Mar 16 '25 16:03 acharraggi

Fixed in v10.3.

bubner avatar Jun 26 '25 00:06 bubner