forked from uncloud/uncloud
++ exception handling
This commit is contained in:
parent
1fba79ca31
commit
bff12ed930
3 changed files with 9 additions and 3 deletions
|
|
@ -2,6 +2,7 @@ import etcd3
|
|||
import json
|
||||
import queue
|
||||
import copy
|
||||
from uncloud import UncloudException
|
||||
|
||||
from collections import namedtuple
|
||||
from functools import wraps
|
||||
|
|
@ -29,9 +30,9 @@ def readable_errors(func):
|
|||
try:
|
||||
return func(*args, **kwargs)
|
||||
except etcd3.exceptions.ConnectionFailedError as err:
|
||||
raise etcd3.exceptions.ConnectionFailedError(
|
||||
"etcd connection failed."
|
||||
) from err
|
||||
raise UncloudException(
|
||||
"Cannot connect to etcd: is etcd running as configured in uncloud.conf?"
|
||||
)
|
||||
except etcd3.exceptions.ConnectionTimeoutError as err:
|
||||
raise etcd3.exceptions.ConnectionTimeoutError(
|
||||
"etcd connection timeout."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue