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;
        
    }