Call onFailure for every exception case even in the case of an error / runtime exception

Closes #2848
This commit is contained in:
Simon Willnauer 2013-04-03 12:25:27 +02:00
parent eb8b38d027
commit bbe619a416
1 changed files with 7 additions and 7 deletions

View File

@ -106,7 +106,7 @@ public class SearchServiceTransportAction extends AbstractComponent {
try { try {
DfsSearchResult result = searchService.executeDfsPhase(request); DfsSearchResult result = searchService.executeDfsPhase(request);
listener.onResult(result); listener.onResult(result);
} catch (Exception e) { } catch (Throwable e) {
listener.onFailure(e); listener.onFailure(e);
} }
} else { } else {
@ -174,7 +174,7 @@ public class SearchServiceTransportAction extends AbstractComponent {
try { try {
QuerySearchResult result = searchService.executeQueryPhase(request); QuerySearchResult result = searchService.executeQueryPhase(request);
listener.onResult(result); listener.onResult(result);
} catch (Exception e) { } catch (Throwable e) {
listener.onFailure(e); listener.onFailure(e);
} }
} else { } else {
@ -208,7 +208,7 @@ public class SearchServiceTransportAction extends AbstractComponent {
try { try {
ScrollQuerySearchResult result = searchService.executeQueryPhase(request); ScrollQuerySearchResult result = searchService.executeQueryPhase(request);
listener.onResult(result.queryResult()); listener.onResult(result.queryResult());
} catch (Exception e) { } catch (Throwable e) {
listener.onFailure(e); listener.onFailure(e);
} }
} else { } else {
@ -242,7 +242,7 @@ public class SearchServiceTransportAction extends AbstractComponent {
try { try {
QueryFetchSearchResult result = searchService.executeFetchPhase(request); QueryFetchSearchResult result = searchService.executeFetchPhase(request);
listener.onResult(result); listener.onResult(result);
} catch (Exception e) { } catch (Throwable e) {
listener.onFailure(e); listener.onFailure(e);
} }
} else { } else {
@ -276,7 +276,7 @@ public class SearchServiceTransportAction extends AbstractComponent {
try { try {
QueryFetchSearchResult result = searchService.executeFetchPhase(request); QueryFetchSearchResult result = searchService.executeFetchPhase(request);
listener.onResult(result); listener.onResult(result);
} catch (Exception e) { } catch (Throwable e) {
listener.onFailure(e); listener.onFailure(e);
} }
} else { } else {
@ -310,7 +310,7 @@ public class SearchServiceTransportAction extends AbstractComponent {
try { try {
ScrollQueryFetchSearchResult result = searchService.executeFetchPhase(request); ScrollQueryFetchSearchResult result = searchService.executeFetchPhase(request);
listener.onResult(result.result()); listener.onResult(result.result());
} catch (Exception e) { } catch (Throwable e) {
listener.onFailure(e); listener.onFailure(e);
} }
} else { } else {
@ -412,7 +412,7 @@ public class SearchServiceTransportAction extends AbstractComponent {
try { try {
ScrollQueryFetchSearchResult result = searchService.executeScan(request); ScrollQueryFetchSearchResult result = searchService.executeScan(request);
listener.onResult(result.result()); listener.onResult(result.result());
} catch (Exception e) { } catch (Throwable e) {
listener.onFailure(e); listener.onFailure(e);
} }
} else { } else {