| 1 | // |
| 2 | // (c) Copyright, Moebius Solutions, 2002 |
| 3 | // |
| 4 | // All Rights Reserved |
| 5 | // |
| 6 | // This material may be reproduced by or for the U. S. Government |
| 7 | // pursuant to the copyright license under the clause at |
| 8 | // DFARS 252.227-7013 (OCT 1988). |
| 9 | // |
| 10 | package com.moesol.generator.core; |
| 11 | |
| 12 | public class MergeException extends Exception{ |
| 13 | public MergeException(Exception root_cause) { |
| 14 | this.root_cause = root_cause; |
| 15 | } |
| 16 | |
| 17 | public MergeException(String message) { |
| 18 | super(message); |
| 19 | } |
| 20 | |
| 21 | public MergeException(String message, Exception root_cause) { |
| 22 | super(message); |
| 23 | this.root_cause = root_cause; |
| 24 | } |
| 25 | |
| 26 | public void setRootCause(Exception root_cause) { |
| 27 | this.root_cause = root_cause; |
| 28 | } |
| 29 | |
| 30 | public Exception getRootCause() { |
| 31 | return root_cause; |
| 32 | } |
| 33 | |
| 34 | public String getMessage(){ |
| 35 | if(root_cause != null){ |
| 36 | return super.getMessage() + " : Nested Exception reported with message = " + root_cause.getMessage(); |
| 37 | } |
| 38 | return super.getMessage(); |
| 39 | } |
| 40 | |
| 41 | private Exception root_cause; |
| 42 | } |