UUIDExceptionWrapper.java

  1. package org.jbehave.core.failures;

  2. import java.util.UUID;

  3. /**
  4.  * Wraps an exception by adding an {@link UUID}. This allows a unique identifier
  5.  * to be used repeatedly to represent the exception throw in a step failure
  6.  * throughout the reports. In particular, it allows failing scenario screenshots
  7.  * to be linked to from the HTML report.
  8.  */
  9. @SuppressWarnings({ "serial", "checkstyle:AbbreviationAsWordInName" })
  10. public class UUIDExceptionWrapper extends RuntimeException {

  11.     private UUID uuid = UUID.randomUUID();

  12.     public UUIDExceptionWrapper(String message, Throwable cause) {
  13.         super(message, cause);
  14.     }

  15.     public UUIDExceptionWrapper(Throwable cause) {
  16.         super(cause);
  17.     }

  18.     public UUIDExceptionWrapper(String s) {
  19.         super(s);
  20.     }

  21.     public UUIDExceptionWrapper() {
  22.     }

  23.     public UUID getUUID() {
  24.         return uuid;
  25.     }

  26. }