forked from svn2github/SpagoBI-V4x
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IN PROGRESS - issue SPAGOBI-1656: Improved error handling in method c…
…reateISecurityServiceSupplier git-svn-id: svn://svn.forge.objectweb.org/svnroot/spagobi/V_4.x/Server/trunk@22385 99afaf0d-6903-0410-885a-c66a8bbb5f81
- Loading branch information
gioia
committed
Mar 24, 2014
1 parent
24175df
commit d55be4a
Showing
2 changed files
with
111 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
SpagoBIDAO/src/it/eng/spagobi/dao/exception/DAORuntimeException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* SpagoBI, the Open Source Business Intelligence suite | ||
* Copyright (C) 2012 Engineering Ingegneria Informatica S.p.A. - SpagoBI Competency Center | ||
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0, without the "Incompatible With Secondary Licenses" notice. | ||
* If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
package it.eng.spagobi.dao.exception; | ||
|
||
import java.io.PrintWriter; | ||
import java.io.StringWriter; | ||
|
||
public class DAORuntimeException extends RuntimeException { | ||
|
||
/** | ||
* Keep compiler happy | ||
*/ | ||
private static final long serialVersionUID = 1L; | ||
|
||
/* | ||
* User oriented description of the exception. It is usually prompted to the user. | ||
* Instead the message passed to the constructor is developer oriented and it should be just logged. | ||
*/ | ||
private String description; | ||
|
||
|
||
/** | ||
* Builds a <code>SpagoBIRuntimeException</code>. | ||
* | ||
* @param message Text of the exception | ||
*/ | ||
public DAORuntimeException(String message) { | ||
super(message); | ||
} | ||
|
||
/** | ||
* Builds a <code>SpagoBIRuntimeException</code>. | ||
* | ||
* @param message Text of the exception | ||
* @param ex previous Throwable object | ||
*/ | ||
public DAORuntimeException(String message, Throwable ex) { | ||
super(message, ex); | ||
} | ||
|
||
/** | ||
* Builds a <code>SpagoBIRuntimeException</code>. | ||
* | ||
* @param ex previous Throwable object | ||
*/ | ||
public DAORuntimeException(Throwable ex) { | ||
super(ex); | ||
} | ||
|
||
public String getRootCause() { | ||
String rootCause; | ||
Throwable rootException; | ||
|
||
rootException = this; | ||
while(rootException.getCause() != null) { | ||
rootException = rootException.getCause(); | ||
} | ||
|
||
rootCause = rootException.getMessage()!=null | ||
? rootException.getClass().getName() + ": " + rootException.getMessage() | ||
: rootException.getClass().getName(); | ||
|
||
return rootCause; | ||
} | ||
|
||
public String getStackTraceDump() { | ||
StringWriter buffer = new StringWriter(); | ||
this.printStackTrace(new PrintWriter(buffer)); | ||
return buffer.toString(); | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
public void setDescription(String description) { | ||
this.description = description; | ||
} | ||
} | ||
|