diff --git a/circuitbreaker.py b/circuitbreaker.py
index 5e4a99b..f81fd7f 100644
--- a/circuitbreaker.py
+++ b/circuitbreaker.py
@@ -17,17 +17,20 @@ class CircuitBreaker(object):
     FAILURE_THRESHOLD = 5
     RECOVERY_TIMEOUT = 30
     EXPECTED_EXCEPTION = Exception
+    FALLBACK_FUNCTION = None
 
     def __init__(self,
                  failure_threshold=None,
                  recovery_timeout=None,
                  expected_exception=None,
-                 name=None):
+                 name=None,
+                 fallback_function=None):
         self._last_failure = None
         self._failure_count = 0
         self._failure_threshold = failure_threshold or self.FAILURE_THRESHOLD
         self._recovery_timeout = recovery_timeout or self.RECOVERY_TIMEOUT
         self._expected_exception = expected_exception or self.EXPECTED_EXCEPTION
+        self._fallback_function = fallback_function or self.FALLBACK_FUNCTION
         self._name = name
         self._state = STATE_CLOSED
         self._opened = datetime.utcnow()
@@ -57,7 +60,10 @@ class CircuitBreaker(object):
         :param func: Decorated function
         """
         if self.opened:
-            raise CircuitBreakerError(self)
+            if self.fallback_function:
+                self.fallback_function(*args, **kwargs)
+            else:
+                raise CircuitBreakerError(self)
         try:
             result = func(*args, **kwargs)
         except self._expected_exception as e:
@@ -127,6 +133,10 @@ class CircuitBreaker(object):
     def last_failure(self):
         return self._last_failure
 
+    @property
+    def fallback_function(self):
+        return self._fallback_function
+
     def __str__(self, *args, **kwargs):
         return self._name
 
@@ -193,6 +203,7 @@ def circuit(failure_threshold=None,
             recovery_timeout=None,
             expected_exception=None,
             name=None,
+            fallback_function=None,
             cls=CircuitBreaker):
 
     # if the decorator is used without parameters, the
@@ -204,4 +215,5 @@ def circuit(failure_threshold=None,
             failure_threshold=failure_threshold,
             recovery_timeout=recovery_timeout,
             expected_exception=expected_exception,
-            name=name)
+            name=name,
+            fallback_function=fallback_function)

Possibility to add a fallback call instead of raise CircuitBreakerError
It could add a parameter like 

```python
def fallback_function():
  return True

@circuit(fallback=fallback_function)
def external_call():
    ...
```

So, when circuit is open, the fallback function is called instead of raise CircuitBreakerError
diff --git a/tests/test_unit.py b/tests/test_unit.py
index 8b6d97c..66793c8 100644
--- a/tests/test_unit.py
+++ b/tests/test_unit.py
@@ -44,6 +44,35 @@ def test_circuitbreaker_should_clear_last_exception_on_success_call():
     assert cb.last_failure is None
 
 
+def test_circuitbreaker_should_call_fallback_function_if_open():
+    fallback = Mock(return_value=True)
+
+    func = Mock(return_value=False)
+
+    CircuitBreaker.opened = lambda self: True
+    
+    cb = CircuitBreaker(name='WithFallback', fallback_function=fallback)
+    cb.call(func)
+    fallback.assert_called_once_with()
+
+def mocked_function(*args, **kwargs):
+    pass
+
+def test_circuitbreaker_call_fallback_function_with_parameters():
+    fallback = Mock(return_value=True)
+
+    cb = circuit(name='with_fallback', fallback_function=fallback)
+
+    # mock opened prop to see if fallback is called with correct parameters.
+    cb.opened = lambda self: True
+    func_decorated = cb.decorate(mocked_function)
+
+    func_decorated('test2',test='test')
+
+    # check args and kwargs are getting correctly to fallback function
+    
+    fallback.assert_called_once_with('test2', test='test')
+
 @patch('circuitbreaker.CircuitBreaker.decorate')
 def test_circuit_decorator_without_args(circuitbreaker_mock):
     function = lambda: True
@@ -54,10 +83,12 @@ def test_circuit_decorator_without_args(circuitbreaker_mock):
 @patch('circuitbreaker.CircuitBreaker.__init__')
 def test_circuit_decorator_with_args(circuitbreaker_mock):
     circuitbreaker_mock.return_value = None
-    circuit(10, 20, KeyError, 'foobar')
+    function_fallback = lambda: True
+    circuit(10, 20, KeyError, 'foobar', function_fallback)
     circuitbreaker_mock.assert_called_once_with(
         expected_exception=KeyError,
         failure_threshold=10,
         recovery_timeout=20,
-        name='foobar'
+        name='foobar',
+        fallback_function=function_fallback
     )

pip install -e .[dev]
parse_log_pytest
requirements.txt
mock pytest pytest-flake8 pytest-mock pytest-cov
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
-e git+https://github.com/fabfuel/circuitbreaker.git@f8d4d2d709cf232466bf80766fd10ebc5da4356b#egg=circuitbreaker
coverage==7.8.0
exceptiongroup==1.2.2
flake8==7.2.0
iniconfig==2.1.0
mccabe==0.7.0
mock==5.2.0
packaging==24.2
pluggy==1.5.0
pycodestyle==2.13.0
pyflakes==3.3.2
pytest==8.3.5
pytest-cov==6.0.0
pytest-flake8==1.3.0
pytest-mock==3.14.0
tomli==2.2.1
typing==3.7.4.3

name: circuitbreaker
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - coverage==7.8.0
      - exceptiongroup==1.2.2
      - flake8==7.2.0
      - iniconfig==2.1.0
      - mccabe==0.7.0
      - mock==5.2.0
      - packaging==24.2
      - pluggy==1.5.0
      - pycodestyle==2.13.0
      - pyflakes==3.3.2
      - pytest==8.3.5
      - pytest-cov==6.0.0
      - pytest-flake8==1.3.0
      - pytest-mock==3.14.0
      - tomli==2.2.1
      - typing==3.7.4.3
prefix: /opt/conda/envs/circuitbreaker

tests/test_unit.py::test_circuitbreaker_should_call_fallback_function_if_open tests/test_unit.py::test_circuitbreaker_call_fallback_function_with_parameters tests/test_unit.py::test_circuit_decorator_with_args
tests/test_unit.py::test_circuitbreaker__str__ tests/test_unit.py::test_circuitbreaker_error__str__ tests/test_unit.py::test_circuitbreaker_should_save_last_exception_on_failure_call tests/test_unit.py::test_circuitbreaker_should_clear_last_exception_on_success_call tests/test_unit.py::test_circuit_decorator_without_args
circuitbreaker.py
circuitbreaker.py