datastoreexception.java
来自「网上商店 新增功能: 1」· Java 代码 · 共 44 行
JAVA
44 行
package netstore.framework.exceptions;
/**
* This exception is used to report an error that occurs when interacting with
* the underlying datastore.
*/
public class DatastoreException extends BaseException {
/**
* Return a DatastoreException for datastoreError condition.
*
* @return The new DatastoreException object.
*/
public static DatastoreException retrieveConstraint() {
Object[] args = {};
DatastoreException datastoreException = new DatastoreException(RETRIEVE_CONSTRAINT, args);
return (datastoreException);
}
public static DatastoreException objectNotFound() {
Object[] args = {};
DatastoreException datastoreException = new DatastoreException(OBJECTNOTFOUND_ERROR, args);
return (datastoreException);
}
public static DatastoreException datastoreError( Throwable rootCause) {
Object[] args = {};
DatastoreException datastoreException = new DatastoreException(DATASTORE_ERROR, args);
datastoreException.setRootCause( rootCause );
return (datastoreException);
}
/**
* For use by subclasses of DatastoreException.
*/
protected DatastoreException(String newErrorCode,
Object[] args) {
super(newErrorCode, args);
}
public static final String RETRIEVE_CONSTRAINT = "RetrieveConstraint";
public static final String DATASTORE_ERROR = "DatastoreError";
public static final String OBJECTNOTFOUND_ERROR = "ObjectNotFound";
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?