Skip to content

Commit

Permalink
#296 giving logic in order to show error message if function fails an…
Browse files Browse the repository at this point in the history
…d show job execution if function is succeeded
  • Loading branch information
Daniel Ventura committed Dec 19, 2022
1 parent f259f2e commit 575d9ea
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions force-app/main/default/classes/mcdo_CreateEnvironments.cls
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
/**
* This class is used by the MC Init function,
* This class is used by the MC Init function, g
* responsible for creating all environments
*/
Global class mcdo_CreateEnvironments implements copado.MCCallback {
Global void execute(copado__Function__c function, copado__Result__c result, String status) {
if(status == 'Failed') {
global class mcdo_CreateEnvironments implements copado.JobExecutionCallback {
global void execute(copado__JobExecution__c job, String status) {
if(status == 'Error') {
// handle Error
} else if(status == 'Success') {
System.debug('Error: ' + job.copado__ErrorMessage__c);
} else if(status == 'Successful') {
// handle Success
System.debug('Entered the createEnvironments callback function with the status equals to "Success"');
System.debug('Job: ' + job);
// TODO: create all the needed environments

} else {
// handle In progress if necessary
System.debug('still in progress...');
}
}
}

0 comments on commit 575d9ea

Please sign in to comment.