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.
First round of exceptions paths cleanup. This commit introduces an Ol…
…apExceptionHandler which was factored out of the XmlaOlap4jConnection class. I made sure that all OlapException get thrown through the helper in the xmla driver. Eventually, we could do the same with the rest of Olap4j. git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@110 c6a108a4-781c-0410-a6c6-c2d559e19af0
- Loading branch information
1 parent
1e25fee
commit 3108dd2
Showing
9 changed files
with
87 additions
and
73 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
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
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
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