forked from olap4j/olap4j
-
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.
git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@114 c6a108a4-781c-0410-a6c6-c2d559e19af0
- Loading branch information
1 parent
bfe29fc
commit 82777df
Showing
26 changed files
with
188 additions
and
795 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
// This software is subject to the terms of the Common Public License | ||
// Agreement, available at the following URL: | ||
// http://www.opensource.org/licenses/cpl.html. | ||
// Copyright (C) 2007-2008 Julian Hyde | ||
// All Rights Reserved. | ||
// You must accept the terms of that agreement to use this software. | ||
*/ | ||
package org.olap4j; | ||
|
||
import java.sql.SQLException; | ||
|
||
/** | ||
* Sugar class to help create OlapExceptions. | ||
* @author Luc Boudreau | ||
* @version $Id: $ | ||
*/ | ||
public class OlapExceptionHelper { | ||
|
||
public static OlapException createException(String msg) { | ||
return new OlapException(msg); | ||
} | ||
|
||
public static OlapException createException(String msg, Throwable cause) { | ||
return new OlapException(msg, cause); | ||
} | ||
|
||
public static OlapException createException(Cell context, String msg) { | ||
OlapException exception = new OlapException(msg); | ||
exception.setContext(context); | ||
return exception; | ||
} | ||
|
||
public static OlapException createException( | ||
Cell context, String msg, Throwable cause) | ||
{ | ||
OlapException exception = new OlapException(msg, cause); | ||
exception.setContext(context); | ||
return exception; | ||
} | ||
|
||
public static OlapException toOlapException(SQLException e) { | ||
if (e instanceof OlapException) { | ||
return (OlapException) e; | ||
} else { | ||
return new OlapException(null, e); | ||
} | ||
} | ||
} | ||
|
||
//End ExceptionHelper.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
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
Oops, something went wrong.