This is an automated email from the ASF dual-hosted git repository. cschneider pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-journal-messages.git
commit 400e23751202886186fa7231f5453c3d1a5c4a98 Author: Christian Schneider <[email protected]> AuthorDate: Fri Jul 5 09:37:48 2019 +0200 SLING-8533 - Expose event property names --- .../apache/sling/distribution/journal/ExceptionEventSender.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/apache/sling/distribution/journal/ExceptionEventSender.java b/src/main/java/org/apache/sling/distribution/journal/ExceptionEventSender.java index f83b4d6..d6fd117 100644 --- a/src/main/java/org/apache/sling/distribution/journal/ExceptionEventSender.java +++ b/src/main/java/org/apache/sling/distribution/journal/ExceptionEventSender.java @@ -33,6 +33,9 @@ import org.osgi.service.event.EventAdmin; public class ExceptionEventSender { public static final String ERROR_TOPIC = "org/apache/sling/distribution/journal/errors"; + public static final String KEY_MESSAGE = "message"; + public static final String KEY_TYPE = "type"; + private final EventAdmin eventAdmin; public ExceptionEventSender(@Nullable EventAdmin eventAdmin) { @@ -41,8 +44,8 @@ public class ExceptionEventSender { private Event createErrorEvent(Exception e) { Map<String, String> props = new HashMap<>(); - props.put("type", e.getClass().getName()); - props.put("message", e.getMessage()); + props.put(KEY_TYPE, e.getClass().getName()); + props.put(KEY_MESSAGE, e.getMessage()); return new Event(ERROR_TOPIC, props); }
