Skip to content

Commit

Permalink
Merge pull request #1263 from GnsP/remove-list-pipelines-call-in-deploy
Browse files Browse the repository at this point in the history
invert error condition in pipeline name exists check
  • Loading branch information
GnsP authored Nov 27, 2024
2 parents e1fa881 + 62c0c2c commit b58f596
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions app/cdap/services/global-constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ const GLOBALS = {
'ARTIFACT-UPLOAD-ERROR-JSON': 'Error in parsing config json for the artifact.',
},
error: {
'GENERIC-BACKEND-ERROR': 'Something went wrong ! Please try again.',
'SYNTAX-CONFIG-JSON':
'Error parsing widgets JSON for the plugin. Please check the documentation to fix.',
'SEMANTIC-CONFIG-JSON': 'Semantic error in the configuration JSON for the plugin.',
Expand Down
16 changes: 12 additions & 4 deletions app/hydrator/services/create/stores/config-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -1368,19 +1368,27 @@ class HydratorPlusPlusConfigStore {
this.EventPipe.emit('hideLoadingIcon.immediate');
};

let displayGenericBackendError = () => {
this.HydratorPlusPlusConsoleActions.addMessage([{
type: 'error',
content: this.GLOBALS.en.hydrator.studio.error['GENERIC-BACKEND-ERROR']
}]);
this.EventPipe.emit('hideLoadingIcon.immediate');
};

// Checking if Pipeline name already exist
this.myAppsApi.get({
this.myAppsApi.get({
namespace: this.$state.params.namespace,
appId: config.name,
}).$promise.then((app) => {
displayPipelineNameExistsError();
}).catch((err) => {
if (err.status !== 404) {
displayPipelineNameExistsError();
} else {
if (err.status === 404) {
delete config.change;
delete config.parentVersion;
publish(config.name);
} else {
displayGenericBackendError();
}
});
}
Expand Down

0 comments on commit b58f596

Please sign in to comment.