1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-12 08:56:13 +01:00

Add oscerr.ProjectError class needed by core.delete_project()

This commit is contained in:
Daniel Mach 2023-01-20 13:51:19 +01:00
parent 7f885ac6b2
commit da029941bc

View File

@ -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"""