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:
commit
4322555d16
|
|
@ -251,11 +251,14 @@ export function* executeQuerySaga(
|
||||||
},
|
},
|
||||||
timeout,
|
timeout,
|
||||||
);
|
);
|
||||||
|
const isValidResponse = yield validateResponse(response);
|
||||||
|
const isExecutionSuccess = response.data.isExecutionSuccess;
|
||||||
|
|
||||||
if (response.responseMeta && response.responseMeta.error) {
|
if (!isExecutionSuccess) {
|
||||||
throw response.responseMeta.error;
|
throw Error(response.data.body.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isValidResponse) {
|
||||||
yield put({
|
yield put({
|
||||||
type: ReduxActionTypes.RUN_QUERY_SUCCESS,
|
type: ReduxActionTypes.RUN_QUERY_SUCCESS,
|
||||||
payload: {
|
payload: {
|
||||||
|
|
@ -270,6 +273,7 @@ export function* executeQuerySaga(
|
||||||
AnalyticsUtil.logEvent("RUN_QUERY", {
|
AnalyticsUtil.logEvent("RUN_QUERY", {
|
||||||
queryName: actionPayload.payload.action.name,
|
queryName: actionPayload.payload.action.name,
|
||||||
});
|
});
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
yield put({
|
yield put({
|
||||||
type: ReduxActionErrorTypes.RUN_QUERY_ERROR,
|
type: ReduxActionErrorTypes.RUN_QUERY_ERROR,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user