@@ -692,9 +692,11 @@ public AbstractObjectParser setSQLConfig(int count, int page, int position) thro
692692 try {
693693 sqlConfig = newSQLConfig (false );
694694 }
695- catch (NotExistException e ) {
696- e .printStackTrace ();
697- return this ;
695+ catch (Exception e ) {
696+ if (e instanceof NotExistException || (e instanceof CommonException && e .getCause () instanceof NotExistException )) {
697+ return this ;
698+ }
699+ throw e ;
698700 }
699701 }
700702 sqlConfig .setCount (sqlConfig .getCount () <= 0 ? count : sqlConfig .getCount ()).setPage (page ).setPosition (position );
@@ -722,18 +724,23 @@ public AbstractObjectParser executeSQL() throws Exception {
722724 try {
723725 sqlReponse = onSQLExecute ();
724726 }
725- catch (NotExistException e ) {
726- // Log.e(TAG, "getObject try { response = getSQLObject(config2); } catch (Exception e) {");
727- // if (e instanceof NotExistException) {//非严重异常,有时候只是数据不存在
728- // // e.printStackTrace();
729- sqlReponse = null ;//内部吃掉异常,put到最外层
730- // requestObject.put(JSONResponse.KEY_MSG
731- // , StringUtil.getString(requestObject.get(JSONResponse.KEY_MSG)
732- // + "; query " + path + " cath NotExistException:"
733- // + newErrorResult(e).getString(JSONResponse.KEY_MSG)));
734- // } else {
735- // throw e;
736- // }
727+ catch (Exception e ) {
728+ if (e instanceof NotExistException || (e instanceof CommonException && e .getCause () instanceof NotExistException )) {
729+ // Log.e(TAG, "getObject try { response = getSQLObject(config2); } catch (Exception e) {");
730+ // if (e instanceof NotExistException) {//非严重异常,有时候只是数据不存在
731+ // // e.printStackTrace();
732+ sqlReponse = null ;//内部吃掉异常,put到最外层
733+ // requestObject.put(JSONResponse.KEY_MSG
734+ // , StringUtil.getString(requestObject.get(JSONResponse.KEY_MSG)
735+ // + "; query " + path + " cath NotExistException:"
736+ // + newErrorResult(e).getString(JSONResponse.KEY_MSG)));
737+ // } else {
738+ // throw e;
739+ // }
740+ }
741+ else {
742+ throw e ;
743+ }
737744 }
738745 }
739746
0 commit comments