Include actual cause's message in various parsing exception messages
This change improves the message of several parsing-related exceptions that would previously entirely swallow the original exception's message and sometimes have a slightly misleading message as a result. This is done by appending the cause's `toString` representation to the IllegalArgumentException messages instead of an hardcoded "cause". Closes gh-32636
This commit is contained in:
@@ -411,7 +411,7 @@ public class ScheduledAnnotationBeanPostProcessor
|
||||
}
|
||||
catch (RuntimeException ex) {
|
||||
throw new IllegalArgumentException(
|
||||
"Invalid initialDelayString value \"" + initialDelayString + "\" - cannot parse into long");
|
||||
"Invalid initialDelayString value \"" + initialDelayString + "\"; " + ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -463,7 +463,7 @@ public class ScheduledAnnotationBeanPostProcessor
|
||||
}
|
||||
catch (RuntimeException ex) {
|
||||
throw new IllegalArgumentException(
|
||||
"Invalid fixedDelayString value \"" + fixedDelayString + "\" - cannot parse into long");
|
||||
"Invalid fixedDelayString value \"" + fixedDelayString + "\"; " + ex);
|
||||
}
|
||||
tasks.add(this.registrar.scheduleFixedDelayTask(new FixedDelayTask(runnable, fixedDelay, delayToUse)));
|
||||
}
|
||||
@@ -489,7 +489,7 @@ public class ScheduledAnnotationBeanPostProcessor
|
||||
}
|
||||
catch (RuntimeException ex) {
|
||||
throw new IllegalArgumentException(
|
||||
"Invalid fixedRateString value \"" + fixedRateString + "\" - cannot parse into long");
|
||||
"Invalid fixedRateString value \"" + fixedRateString + "\"; " + ex);
|
||||
}
|
||||
tasks.add(this.registrar.scheduleFixedRateTask(new FixedRateTask(runnable, fixedRate, delayToUse)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user