mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11:43 +00:00
Override getMessage in Exceptions instead of toString (#7002)
Fixes https://errorprone.info/bugpattern/OverrideThrowableToString
This commit is contained in:
@@ -16,9 +16,4 @@ public class VideoException extends RuntimeException {
|
||||
public VideoException(String msg) {
|
||||
super(msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "VideoException [" + super.toString() + "]";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ public class BadSchemaException extends Exception {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return m_field.isEmpty() ? getMessage() : "field " + m_field + ": " + getMessage();
|
||||
public String getMessage() {
|
||||
return m_field.isEmpty() ? super.getMessage() : "field " + m_field + ": " + super.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class ParseException extends Exception {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return m_pos + ": " + getMessage();
|
||||
public String getMessage() {
|
||||
return m_pos + ": " + super.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user