public function exception($errorMsg,  array $trace, $error = true )
    {
        $classException = "CheckoutApi_Lib_ExceptionState";

        if (class_exists($classException)) {

            /** @var CheckoutApi_Lib_ExceptionState $class */
            $class = CheckoutApi_Lib_Factory::getSingletonInstance($classException);
              
        } else {
            
            throw new Exception("Not a valid class ::  CheckoutApi_Lib_ExceptionState");
            
        } 

        $class->setLog($errorMsg,$trace,$error);

        return $class;
        
    }
public function exception($errorMsg,  array $trace, $error = true )
    {
        $classException = "CheckoutApi_Lib_ExceptionState";

        if (class_exists($classException)) {

            /** @var CheckoutApi_Lib_ExceptionState $class */
            $class = CheckoutApi_Lib_Factory::getSingletonInstance($classException);
              
        } else {
            
            throw new Exception("Not a valid class ::  CheckoutApi_Lib_ExceptionState");
            
        } 

        $class->setLog($errorMsg,$trace,$error);

        return $class;
        
    }
public function exception ( $ errorMsg , array $ trace , $ error = true ) { $ classException = "CheckoutApi_Lib_ExceptionState" ; if ( class_exists ( $ classException ) ) { /** @var CheckoutApi_Lib_ExceptionState $class */ $ class = CheckoutApi_Lib_Factory :: getSingletonInstance ( $ classException ) ; } else { throw new Exception ( "Not a valid class ::  CheckoutApi_Lib_ExceptionState" ) ; } $ class -> setLog ( $ errorMsg , $ trace , $ error ) ; return $ class ; }
setting and logging error message
@param string $errorMsg error message you wan to log
@param array $trace stack trace
@param bool $error state of the error. true for important error
@return mixed
@throws Exception
setting and logging error message