Add a `ApplicationLogError` custom exc instead
parent
019867b413
commit
4c7c78c815
|
@ -37,7 +37,7 @@ from docker.models.containers import Container as DockerContainer
|
|||
from docker.errors import (
|
||||
DockerException,
|
||||
APIError,
|
||||
ContainerError,
|
||||
# ContainerError,
|
||||
)
|
||||
from requests.exceptions import ConnectionError, ReadTimeout
|
||||
|
||||
|
@ -51,6 +51,10 @@ class DockerNotStarted(Exception):
|
|||
'Prolly you dint start da daemon bruh'
|
||||
|
||||
|
||||
class ApplicationLogError(Exception):
|
||||
'App in container reported an error in logs'
|
||||
|
||||
|
||||
@acm
|
||||
async def open_docker(
|
||||
url: Optional[str] = None,
|
||||
|
@ -153,7 +157,7 @@ class Container:
|
|||
|
||||
# print(f'level: {level}')
|
||||
if level in ('error', 'fatal'):
|
||||
raise ContainerError(msg)
|
||||
raise ApplicationLogError(msg)
|
||||
|
||||
if patt in msg:
|
||||
return True
|
||||
|
|
Loading…
Reference in New Issue