Details
-
Improvement
-
Status: Open
-
Trivial
-
Resolution: Unresolved
-
Event 3.7.6, Event 4.0.2
-
None
Description
Add message to notify the user why his event is invalid.
File: org/apache/sling/event/impl/jobs/Utility.java:50
- Change code attached.
/**
- Check the job topic.
- @return <code>null</code> if the topic is correct, otherwise an error description is returned
*/
public static String checkJobTopic(final Object jobTopic) {
final String message;
if ( jobTopic != null ) {
if ( jobTopic instanceof String )Unknown macro: { boolean topicIsCorrect = false; String exceptionDetails = EMPTY; try { new Event((String)jobTopic, (Dictionary<String, Object>)null); topicIsCorrect = true; } catch (final IllegalArgumentException iae) { exceptionDetails = iae.getLocalizedMessage(); } if ( !topicIsCorrect ) { message = "Discarding job - job has an illegal job topic, due to: ".concat(exceptionDetails); } else { message = null; } }else
{ message = "Discarding job - job topic is not of type string"; }} else
{ message = "Discarding job - job topic is missing"; }return message;
}
Attachments
Attachments
Issue Links
- links to