src/SA/CpeSdk/CpeActivity.php
public function activityFail($error = "", $cause = "")
    {
        $context = [
            'error' => $error,
            'cause' => $cause,
            'taskToken' => $this->token
        ];

        try {
            $this->cpeLogger->logOut("ERROR", basename(__FILE__),
                                     "\033[1m[$error]\033[0m $cause",
                                     $this->logKey);

            $this->cpeSfnHandler->sfn->sendTaskFailure($context);

            // Notify the client if any
            if ($this->client)
                $this->client->onFail($this->token, $error, $cause);

        } catch (\Exception $e) {
            $this->cpeLogger->logOut("ERROR", basename(__FILE__),
                                     "Unable to send 'Task Failure' to Sfn! " . $e->getMessage(),
                                     $this->logKey);

            // Notify the client if any
            if ($this->client)
                $this->client->onException($context, $e);

            return false;
        }

        return true;
    }
public function activityFail($error = "", $cause = "")
    {
        $context = [
            'error' => $error,
            'cause' => $cause,
            'taskToken' => $this->token
        ];

        try {
            $this->cpeLogger->logOut("ERROR", basename(__FILE__),
                                     "\033[1m[$error]\033[0m $cause",
                                     $this->logKey);

            $this->cpeSfnHandler->sfn->sendTaskFailure($context);

            // Notify the client if any
            if ($this->client)
                $this->client->onFail($this->token, $error, $cause);

        } catch (\Exception $e) {
            $this->cpeLogger->logOut("ERROR", basename(__FILE__),
                                     "Unable to send 'Task Failure' to Sfn! " . $e->getMessage(),
                                     $this->logKey);

            // Notify the client if any
            if ($this->client)
                $this->client->onException($context, $e);

            return false;
        }

        return true;
    }
public function activityFail ( $ error = "" , $ cause = "" ) { $ context = [ 'error' => $ error , 'cause' => $ cause , 'taskToken' => $ this -> token ] ; try { $ this -> cpeLogger -> logOut ( "ERROR" , basename ( __FILE__ ) , "\033[1m[$error]\033[0m $cause" , $ this -> logKey ) ; $ this -> cpeSfnHandler -> sfn -> sendTaskFailure ( $ context ) ; // Notify the client if any if ( $ this -> client ) $ this -> client -> onFail ( $ this -> token , $ error , $ cause ) ; } catch ( \ Exception $ e ) { $ this -> cpeLogger -> logOut ( "ERROR" , basename ( __FILE__ ) , "Unable to send 'Task Failure' to Sfn! " . $ e -> getMessage ( ) , $ this -> logKey ) ; // Notify the client if any if ( $ this -> client ) $ this -> client -> onException ( $ context , $ e ) ; return false ; } return true ; }
Activity failed
Called by parent Activity when something went wrong
Notifies Sfn that the activity has failed

Return false ONLY if Sfn call failed.
True otherwise, even of your client interface failed as the Sfn work is successful.
Activity failed Called by parent Activity when something went wrong Notifies Sfn that the activity has failed