Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom exceptions for task job validation #269

Open
github-actions bot opened this issue Feb 23, 2023 · 0 comments
Open

Custom exceptions for task job validation #269

github-actions bot opened this issue Feb 23, 2023 · 0 comments
Assignees
Labels

Comments

@github-actions
Copy link
Contributor

Custom exceptions for task job validation

raise FileExistsError(

f"File already exists at provided output path {self.output_file_path}"

)

# TODO: Custom exceptions for task job validation

            )


@dataclass(frozen=True, init=True)
class SplitTaskJob(TaskJob):
    segment_number: int
    segment_range_in: int
    segment_range_out: int

    def __post_init__(self):
        # TODO: Custom exceptions for task job validation

        if not os.path.exists(self.source.file_path):  # SOURCE ACCESSIBLE
            raise FileNotFoundError(
                f"Provided source file '{self.source.file_path}' does not exist"
            )

        # if os.path.exists(self.):  # NO OVERWRITE
        #     raise FileExistsError(
        #         f"File already exists at provided output path {self.output_file_path}"
        #     )
        if self.input_level not in [
            "in_range=full",
            "in_range=limited",
        ]:  # CHECK VALID VIDEO LEVELS
            raise ValueError(
                f"Calculated video levels are invalid: '{self.input_level}'"
            )


def ffmpeg_video_flip(job: TaskJob):
    flip_string = ""
    if job.source.h_flip:

ca1bee3f16b2f1af9c8177011359bf60f5d3ecbb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant