Skip to content

Commit 4a4db42

Browse files
committed
refactor: better naming for exporter exception
1 parent 3a0da04 commit 4a4db42

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

ytfetcher/exceptions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ class ExporterError(Exception):
88
Base exception for all Exporter errors.
99
"""
1010

11-
class SystemPathCannotFound(ExporterError):
11+
class OutputDirectoryNotFoundError(ExporterError):
1212
"""
13-
Raises when specified path cannot found.
13+
Raised when the specified output directory does not exist.
1414
"""
1515

1616
class NoDataToExport(ExporterError):

ytfetcher/services/exports.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from abc import ABC, abstractmethod
22
from pathlib import Path
33
from ytfetcher.models.channel import ChannelData
4-
from ytfetcher.exceptions import NoDataToExport, SystemPathCannotFound
4+
from ytfetcher.exceptions import NoDataToExport, OutputDirectoryNotFoundError
55
from typing import Literal, Sequence
66
import json
77
import csv
@@ -39,7 +39,7 @@ def __init__(self, channel_data: list[ChannelData], allowed_metadata_list: Seque
3939
raise NoDataToExport("No data to export.")
4040

4141
if not self.output_dir.exists():
42-
raise SystemPathCannotFound("System path cannot found.")
42+
raise OutputDirectoryNotFoundError("System path could not found.")
4343

4444
@abstractmethod
4545
def write(self) -> None:

0 commit comments

Comments
 (0)