diff --git a/pyproject.toml b/pyproject.toml index 9907ccf..ec0b38a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "simple-recorder" -version = "0.3.4" +version = "0.3.5" description = "A simple OBS recorder" authors = [{ name = "onyx-and-iris", email = "code@onyxandiris.online" }] dependencies = [ diff --git a/src/simple_recorder/directory.py b/src/simple_recorder/directory.py index cc35a9f..c9bd4b9 100644 --- a/src/simple_recorder/directory.py +++ b/src/simple_recorder/directory.py @@ -32,5 +32,5 @@ class Directory(Command): f"Current recording directory: {highlight(resp.record_directory)}" ) return resp.record_directory - except TimeoutError: + except (ConnectionRefusedError, TimeoutError): raise SimpleRecorderError("Failed to connect to OBS. Is it running?") diff --git a/src/simple_recorder/pause.py b/src/simple_recorder/pause.py index ac2ed2d..bd9547b 100644 --- a/src/simple_recorder/pause.py +++ b/src/simple_recorder/pause.py @@ -26,5 +26,5 @@ class Pause(Command): client.pause_record() print("Recording paused successfully.") - except TimeoutError: + except (ConnectionRefusedError, TimeoutError): raise SimpleRecorderError("Failed to connect to OBS. Is it running?") diff --git a/src/simple_recorder/resume.py b/src/simple_recorder/resume.py index 2d8c5f1..cef684b 100644 --- a/src/simple_recorder/resume.py +++ b/src/simple_recorder/resume.py @@ -26,5 +26,5 @@ class Resume(Command): client.resume_record() print("Recording resumed successfully.") - except TimeoutError: + except (ConnectionRefusedError, TimeoutError): raise SimpleRecorderError("Failed to connect to OBS. Is it running?") diff --git a/src/simple_recorder/start.py b/src/simple_recorder/start.py index 68ae720..b8962ec 100644 --- a/src/simple_recorder/start.py +++ b/src/simple_recorder/start.py @@ -45,5 +45,5 @@ class Start(Command): ) client.start_record() print(f"Recording started with filename: {highlight(filename)}") - except TimeoutError: + except (ConnectionRefusedError, TimeoutError): raise SimpleRecorderError("Failed to connect to OBS. Is it running?") diff --git a/src/simple_recorder/stop.py b/src/simple_recorder/stop.py index a618d47..bc0d54f 100644 --- a/src/simple_recorder/stop.py +++ b/src/simple_recorder/stop.py @@ -25,5 +25,5 @@ class Stop(Command): client.stop_record() print(highlight("Recording stopped successfully.")) - except TimeoutError: + except (ConnectionRefusedError, TimeoutError): raise SimpleRecorderError("Failed to connect to OBS. Is it running?")