SwerveDriveSpecialties / Do-not-use-swerve-lib-2022-unmaintained

31 stars 77 forks source link

Remove Exception Throws #7

Closed JCaporuscio closed 2 years ago

JCaporuscio commented 2 years ago

Currently the factory code for both CTRE and Rev devices in this library throw exceptions if error codes are non-zero.

Example: https://github.com/SwerveDriveSpecialties/swerve-lib/blob/master/src/main/java/com/swervedrivespecialties/swervelib/ctre/CtreUtils.java#L11

No code in an FRC project should ever intentionally throw an error as unhandled exceptions will crash the program - this is disastrous in a competition environment. For the CTRE library, any error messages will be printed to the DS console and users have the option to check the error return codes and perform whatever logic/correction/retry they desire.

Any and all exception throwing should either be replaced with print statements/error handling logic or just removed entirely.