@@ -16,6 +16,18 @@ public List<String> getAllowedImageVersions() {
1616 return allowedImageVersions ;
1717 }
1818
19+ private static String parseMessage (String imageVersion ) {
20+ return "Invalid RoboRIO Image Version!" +
21+ "\n RoboRIO image and GradleRIO versions are incompatible:" +
22+ "\n \t Current image version: " + imageVersion +
23+ "\n \t GradleRIO-compatible image versions: 2024_v2.* except 2024_v2.0" +
24+ "\n See https://docs.wpilib.org/en/stable/docs/zero-to-robot/step-3/imaging-your-roborio.html" +
25+ "for information about upgrading the RoboRIO image." +
26+ "\n See https://docs.wpilib.org/en/stable/docs/zero-to-robot/step-2/wpilib-setup.html and" +
27+ "\n https://docs.wpilib.org/en/stable/docs/software/vscode-overview/importing-gradle-project.html" +
28+ "\n for information about updating WPILib and GradleRIO." ;
29+ }
30+
1931 private static String parseMessage (String imageVersion , List <String > allowedImageVersions ) {
2032 return "Invalid RoboRIO Image Version!" +
2133 "\n RoboRIO image and GradleRIO versions are incompatible:" +
@@ -34,6 +46,12 @@ public InvalidImageException(String imageVersion, List<String> allowedImageVersi
3446 this .allowedImageVersions = new ArrayList <>(allowedImageVersions );
3547 }
3648
49+ public InvalidImageException (String imageVersion , boolean isSpecialCase ) {
50+ super (parseMessage (imageVersion ));
51+ this .imageVersion = imageVersion ;
52+ this .allowedImageVersions = new ArrayList <>();
53+ }
54+
3755 public InvalidImageException () {
3856 super ("Could not parse image version!" );
3957 allowedImageVersions = List .of ();
0 commit comments