catch ConnectionRefusedError as well as TimeoutError

patch bump
This commit is contained in:
onyx-and-iris 2025-06-30 07:44:23 +01:00
parent c39b909d11
commit b7c25525a1
6 changed files with 6 additions and 6 deletions

View File

@ -1,6 +1,6 @@
[project] [project]
name = "simple-recorder" name = "simple-recorder"
version = "0.3.4" version = "0.3.5"
description = "A simple OBS recorder" description = "A simple OBS recorder"
authors = [{ name = "onyx-and-iris", email = "code@onyxandiris.online" }] authors = [{ name = "onyx-and-iris", email = "code@onyxandiris.online" }]
dependencies = [ dependencies = [

View File

@ -32,5 +32,5 @@ class Directory(Command):
f"Current recording directory: {highlight(resp.record_directory)}" f"Current recording directory: {highlight(resp.record_directory)}"
) )
return resp.record_directory return resp.record_directory
except TimeoutError: except (ConnectionRefusedError, TimeoutError):
raise SimpleRecorderError("Failed to connect to OBS. Is it running?") raise SimpleRecorderError("Failed to connect to OBS. Is it running?")

View File

@ -26,5 +26,5 @@ class Pause(Command):
client.pause_record() client.pause_record()
print("Recording paused successfully.") print("Recording paused successfully.")
except TimeoutError: except (ConnectionRefusedError, TimeoutError):
raise SimpleRecorderError("Failed to connect to OBS. Is it running?") raise SimpleRecorderError("Failed to connect to OBS. Is it running?")

View File

@ -26,5 +26,5 @@ class Resume(Command):
client.resume_record() client.resume_record()
print("Recording resumed successfully.") print("Recording resumed successfully.")
except TimeoutError: except (ConnectionRefusedError, TimeoutError):
raise SimpleRecorderError("Failed to connect to OBS. Is it running?") raise SimpleRecorderError("Failed to connect to OBS. Is it running?")

View File

@ -45,5 +45,5 @@ class Start(Command):
) )
client.start_record() client.start_record()
print(f"Recording started with filename: {highlight(filename)}") print(f"Recording started with filename: {highlight(filename)}")
except TimeoutError: except (ConnectionRefusedError, TimeoutError):
raise SimpleRecorderError("Failed to connect to OBS. Is it running?") raise SimpleRecorderError("Failed to connect to OBS. Is it running?")

View File

@ -25,5 +25,5 @@ class Stop(Command):
client.stop_record() client.stop_record()
print(highlight("Recording stopped successfully.")) print(highlight("Recording stopped successfully."))
except TimeoutError: except (ConnectionRefusedError, TimeoutError):
raise SimpleRecorderError("Failed to connect to OBS. Is it running?") raise SimpleRecorderError("Failed to connect to OBS. Is it running?")