From da029941bc78cd708f3db0c80a9327f904b6fd0b Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Fri, 20 Jan 2023 13:51:19 +0100 Subject: [PATCH] Add oscerr.ProjectError class needed by core.delete_project() --- osc/oscerr.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/osc/oscerr.py b/osc/oscerr.py index 7441d99f..afd272d6 100644 --- a/osc/oscerr.py +++ b/osc/oscerr.py @@ -126,6 +126,21 @@ class WorkingCopyOutdated(OscBaseError): % (self.args[0], self.args[1], self.args[2])) +class ProjectError(OscBaseError): + """Base class for all Project related exceptions""" + + def __init__(self, prj, msg=None): + super().__init__() + self.prj = prj + self.msg = msg + + def __str__(self): + result = f"{self.__class__.__name__}: {self.prj}" + if self.msg: + result += f": {self.msg}" + return result + + class PackageError(OscBaseError): """Base class for all Package related exceptions"""