Skip to content

Commit 199c16c

Browse files
authored
Merge pull request #1640 from kirtangajjar/fix/rsp-hide-error
Add variable to hide error message
2 parents 0847534 + 742671e commit 199c16c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

php/EE/RevertableStepProcessor.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function add_step( string $context, callable $up_step, callable $down_ste
4646
*
4747
* @return boolean Returns if the pending steps were executed successfully.
4848
*/
49-
public function execute() {
49+
public function execute( $show_error = true ) {
5050
$steps_to_execute = array_slice( $this->steps, $this->execution_index );
5151

5252
foreach ( $steps_to_execute as $step ) {
@@ -59,7 +59,9 @@ public function execute() {
5959
} catch ( \Exception $e ) {
6060
$exception_message = $e->getMessage();
6161
$callable = EE\Utils\get_callable_name( $step['up'] );
62-
EE::error( "Encountered error while processing $context in $callable. Exception: $exception_message", false );
62+
if ( $show_error ) {
63+
EE::error( "Error while executing $context. $callable: $exception_message", false );
64+
}
6365
$this->rollback();
6466
$this->steps = [];
6567

0 commit comments

Comments
 (0)