Merge branch 'fix/runQueryTwice' into 'release'

Use isExecutionSuccess flag to handle query execution errors

See merge request theappsmith/internal-tools-client!684
This commit is contained in:
Arpit Mohan 2020-06-10 12:25:54 +00:00
commit 4322555d16

View File

@ -251,11 +251,14 @@ export function* executeQuerySaga(
},
timeout,
);
const isValidResponse = yield validateResponse(response);
const isExecutionSuccess = response.data.isExecutionSuccess;
if (response.responseMeta && response.responseMeta.error) {
throw response.responseMeta.error;
if (!isExecutionSuccess) {
throw Error(response.data.body.toString());
}
if (isValidResponse) {
yield put({
type: ReduxActionTypes.RUN_QUERY_SUCCESS,
payload: {
@ -270,6 +273,7 @@ export function* executeQuerySaga(
AnalyticsUtil.logEvent("RUN_QUERY", {
queryName: actionPayload.payload.action.name,
});
}
} catch (error) {
yield put({
type: ReduxActionErrorTypes.RUN_QUERY_ERROR,