feat: implement AttributeError in Service initialization
This commit is contained in:
parent
82e7951444
commit
b091f41699
1 changed files with 2 additions and 2 deletions
|
@ -18,10 +18,10 @@ class Service:
|
||||||
self._name = name
|
self._name = name
|
||||||
|
|
||||||
if image is None and extends is None:
|
if image is None and extends is None:
|
||||||
raise ValueError(f"Both image and extends are not defined in service '{name}', aborting.")
|
raise AttributeError(f"Both image and extends are not defined in service '{name}', aborting.")
|
||||||
|
|
||||||
if image is not None and extends is not None:
|
if image is not None and extends is not None:
|
||||||
raise ValueError(f"Only one of image and extends can be defined in service '{name}', aborting.")
|
raise AttributeError(f"Only one of image and extends can be defined in service '{name}', aborting.")
|
||||||
|
|
||||||
self._image = image
|
self._image = image
|
||||||
self._ports = ports
|
self._ports = ports
|
||||||
|
|
Loading…
Reference in a new issue