From de00950c39882bec010200a7c79253328ae2cfa3 Mon Sep 17 00:00:00 2001
From: Nelson Tavares de Sousa <ntd@informatik.uni-kiel.de>
Date: Mon, 26 Jan 2015 16:49:56 +0100
Subject: [PATCH] added StageException

---
 src/changes/changes.xml                       | 12 ++++++--
 .../teetime/framework/StageException.java     | 30 +++++++++++++++++++
 2 files changed, 39 insertions(+), 3 deletions(-)
 create mode 100644 src/main/java/teetime/framework/StageException.java

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 7ca35aac..cb6f4802 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -5,12 +5,18 @@
 		<title>Release notes</title>
 	</properties>
 	<body>
-		<release version="Snapshot" date="Daily basis" description="Unstable preview of oncoming versions">
-			<action dev="ntd" type="add" issue="66">
-				Created a new site to promote TeeTime.
+		<release version="Snapshot" date="Daily basis"
+			description="Unstable preview of oncoming versions">
+			<action dev="ntd" type="add" issue="32">
+				Introduced a generic exception handling for stages.
 			</action>
+
 		</release>
 		<release version="1.0" date="Soon" description="Initial release">
+			<action dev="ntd" type="add" issue="66">
+				Created a new site to
+				promote TeeTime.
+			</action>
 			<action type="add">
 				Initial release of TeeTime
 			</action>
diff --git a/src/main/java/teetime/framework/StageException.java b/src/main/java/teetime/framework/StageException.java
new file mode 100644
index 00000000..c1a6a8da
--- /dev/null
+++ b/src/main/java/teetime/framework/StageException.java
@@ -0,0 +1,30 @@
+package teetime.framework;
+
+/**
+ * Represents an Exception, which is thrown by stages, if uncatched exceptions are thrown.
+ *
+ */
+public class StageException extends Exception {
+
+	/**
+	 * Generated UID
+	 */
+	private static final long serialVersionUID = 6724637605943897808L;
+
+	private final Stage throwingStage;
+
+	public StageException(final Stage throwingStage) {
+		super();
+		this.throwingStage = throwingStage;
+	}
+
+	/**
+	 * Returns the stage, which failed with an uncatched exception
+	 *
+	 * @return stage instance, which throws the exception
+	 */
+	public Stage getThrowingStage() {
+		return throwingStage;
+	}
+
+}
-- 
GitLab