Skip to content

Commit 5828155

Browse files
committed
errors
1 parent e128d3a commit 5828155

File tree

1 file changed

+12
-6
lines changed
  • packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/webserver

1 file changed

+12
-6
lines changed

packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/webserver/errors.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
from common_library.errors_classes import (
2-
OsparcErrorMixin,
3-
)
1+
from common_library.errors_classes import OsparcErrorMixin
42

3+
from ..._errors import RPCServerError
54

6-
class WebServerRpcError(OsparcErrorMixin, Exception):
7-
msg_template = "{details}"
5+
6+
class WebServerRpcError(RPCServerError):
7+
msg_template = "{domain_error_nessage} [{domain_error_type_name}]"
88

99
@classmethod
1010
def from_domain_error(cls, err: OsparcErrorMixin):
11-
return cls(details=f"{err} [{err.__class__.__name__}]", **err.error_context())
11+
return cls(
12+
# composes a message
13+
domain_error_nessage=err.message,
14+
domain_error_type_name=f"{err.__class__.__name__}",
15+
# copies context
16+
**err.error_context(),
17+
)
1218

1319

1420
class ProjectNotFoundRpcError(WebServerRpcError): ...

0 commit comments

Comments
 (0)