Skip to content

Commit d43d9fb

Browse files
committed
Raise RuntimeError instead of raising Exception
Signed-off-by: Sahas Subramanian <[email protected]>
1 parent a0be058 commit d43d9fb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

noxfile.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def min_dependencies() -> List[str]:
6060
"""Extract the minimum dependencies from pyproject.toml.
6161
6262
Raises:
63-
Exception: If minimun dependencies are not properly
63+
RuntimeError: If minimun dependencies are not properly
6464
set in pyproject.toml.
6565
6666
Returns:
@@ -72,15 +72,15 @@ def min_dependencies() -> List[str]:
7272

7373
dependencies = data.get("project", {}).get("dependencies", {})
7474
if not dependencies:
75-
raise Exception(f"No dependencies found in file: {toml_file.name}")
75+
raise RuntimeError(f"No dependencies found in file: {toml_file.name}")
7676

7777
min_deps: List[str] = []
7878
for dep in dependencies:
7979
min_dep = dep.split(",")[0]
8080
if any(op in min_dep for op in (">=", "==")):
8181
min_deps.append(min_dep.replace(">=", "=="))
8282
else:
83-
raise Exception(f"Minimum requirement is not set: {dep}")
83+
raise RuntimeError(f"Minimum requirement is not set: {dep}")
8484
return min_deps
8585

8686

src/frequenz/sdk/actor/_resampling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ async def _subscribe(self, request: ComponentMetricRequest) -> None:
8282

8383
async def sink_adapter(sample: Sample) -> None:
8484
if not await sender.send(sample):
85-
raise Exception(f"Error while sending with sender {sender}", sender)
85+
raise RuntimeError(f"Error while sending with sender {sender}", sender)
8686

8787
self._resampler.add_timeseries(request_channel_name, receiver, sink_adapter)
8888

0 commit comments

Comments
 (0)