diff --git a/longbow/entrypoints.py b/longbow/entrypoints.py
index f413500..741d850 100644
--- a/longbow/entrypoints.py
+++ b/longbow/entrypoints.py
@@ -317,6 +317,8 @@ def launcher():
 
             LOG.error(err)
 
+        exit(1)
+
     # Show nice exit message.
     finally:
 

Longbow should exit with non zero when error occurs
Friendly error logging has lead to Longbow exiting with non zero error code. This should not be the case.

Raised by @drewsilcock
diff --git a/tests/unit/entrypoints/test_launcher.py b/tests/unit/entrypoints/test_launcher.py
index 17bdaeb..0747316 100644
--- a/tests/unit/entrypoints/test_launcher.py
+++ b/tests/unit/entrypoints/test_launcher.py
@@ -36,6 +36,7 @@ entrypoint module.
 """
 
 import os
+import pytest
 
 try:
 
@@ -245,12 +246,14 @@ def test_main_test5(m_isfile, m_update, m_recovery, m_longbow):
             "--log", "new-log.file", "--verbose"]
 
     with mock.patch('sys.argv', args):
-
-        launcher()
+        with pytest.raises(SystemExit) as err:
+            launcher()
 
     assert m_longbow.call_count == 0
     assert m_recovery.call_count == 0
     assert m_update.call_count == 0
+    assert err.type == SystemExit
+    assert err.value.code == 1
 
 
 @mock.patch('longbow.entrypoints.longbow')
@@ -270,8 +273,8 @@ def test_main_test6(m_isfile, m_longbowmain):
     m_longbowmain.side_effect = exceptions.PluginattributeError
 
     with mock.patch('sys.argv', args):
-
-        launcher()
+        with pytest.raises(SystemExit) as err:
+            launcher()
 
     params = m_longbowmain.call_args[0][1]
 
@@ -289,6 +292,8 @@ def test_main_test6(m_isfile, m_longbowmain):
     assert params["resource"] == "big-machine"
     assert params["replicates"] == ""
     assert params["verbose"] is False
+    assert err.type == SystemExit
+    assert err.value.code == 1
 
 
 @mock.patch('longbow.entrypoints.longbow')
@@ -308,8 +313,8 @@ def test_main_test7(m_isfile, m_longbowmain):
     m_longbowmain.side_effect = exceptions.PluginattributeError
 
     with mock.patch('sys.argv', args):
-
-        launcher()
+        with pytest.raises(SystemExit) as err:
+            launcher()
 
     params = m_longbowmain.call_args[0][1]
 
@@ -327,6 +332,8 @@ def test_main_test7(m_isfile, m_longbowmain):
     assert params["resource"] == "big-machine"
     assert params["replicates"] == ""
     assert params["verbose"] is False
+    assert err.type == SystemExit
+    assert err.value.code == 1
 
 
 @mock.patch('longbow.entrypoints.recovery')
@@ -344,11 +351,13 @@ def test_main_test8(m_isfile, m_longbowmain, m_recovery):
             "--debug"]
 
     with mock.patch('sys.argv', args):
-
-        launcher()
+        with pytest.raises(SystemExit) as err:
+            launcher()
 
     assert m_longbowmain.call_count == 0
     assert m_recovery.call_count == 0
+    assert err.type == SystemExit
+    assert err.value.code == 1
 
 
 @mock.patch('longbow.staging.cleanup')

pip install -e .
parse_log_pytest
requirements.txt
pytest mock coverage
3.6
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs==22.2.0
certifi==2021.5.30
coverage==6.2
importlib-metadata==4.8.3
iniconfig==1.1.1
-e git+https://github.com/HECBioSim/Longbow.git@51288dd52da6e2223d019fc1b91f5670c15b734f#egg=Longbow
mock==5.2.0
packaging==21.3
pluggy==1.0.0
py==1.11.0
pyparsing==3.1.4
pytest==7.0.1
tomli==1.2.3
typing_extensions==4.1.1
zipp==3.6.0

name: Longbow
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
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - 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=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==22.2.0
      - coverage==6.2
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - mock==5.2.0
      - packaging==21.3
      - pluggy==1.0.0
      - py==1.11.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - zipp==3.6.0
prefix: /opt/conda/envs/Longbow

tests/unit/entrypoints/test_launcher.py::test_main_test5 tests/unit/entrypoints/test_launcher.py::test_main_test6 tests/unit/entrypoints/test_launcher.py::test_main_test7 tests/unit/entrypoints/test_launcher.py::test_main_test8
tests/unit/entrypoints/test_launcher.py::test_main_test1 tests/unit/entrypoints/test_launcher.py::test_main_test2 tests/unit/entrypoints/test_launcher.py::test_main_test3 tests/unit/entrypoints/test_launcher.py::test_main_test4 tests/unit/entrypoints/test_launcher.py::test_main_test9 tests/unit/entrypoints/test_launcher.py::test_main_test10 tests/unit/entrypoints/test_launcher.py::test_main_test11 tests/unit/entrypoints/test_launcher.py::test_main_test12 tests/unit/entrypoints/test_launcher.py::test_main_test13
longbow/entrypoints.py
longbow/entrypoints.py