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 (
|
from docker.errors import (
|
||||||
DockerException,
|
DockerException,
|
||||||
APIError,
|
APIError,
|
||||||
ContainerError,
|
# ContainerError,
|
||||||
)
|
)
|
||||||
from requests.exceptions import ConnectionError, ReadTimeout
|
from requests.exceptions import ConnectionError, ReadTimeout
|
||||||
|
|
||||||
|
@ -51,6 +51,10 @@ class DockerNotStarted(Exception):
|
||||||
'Prolly you dint start da daemon bruh'
|
'Prolly you dint start da daemon bruh'
|
||||||
|
|
||||||
|
|
||||||
|
class ApplicationLogError(Exception):
|
||||||
|
'App in container reported an error in logs'
|
||||||
|
|
||||||
|
|
||||||
@acm
|
@acm
|
||||||
async def open_docker(
|
async def open_docker(
|
||||||
url: Optional[str] = None,
|
url: Optional[str] = None,
|
||||||
|
@ -153,7 +157,7 @@ class Container:
|
||||||
|
|
||||||
# print(f'level: {level}')
|
# print(f'level: {level}')
|
||||||
if level in ('error', 'fatal'):
|
if level in ('error', 'fatal'):
|
||||||
raise ContainerError(msg)
|
raise ApplicationLogError(msg)
|
||||||
|
|
||||||
if patt in msg:
|
if patt in msg:
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue