mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-04-20 08:20:02 +02:00
changes exception raised by @frontend decorator
This commit is contained in:
parent
a7ce321506
commit
9616c57c38
@ -27,7 +27,7 @@ class SerializationValueError(Exception):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class KeywordArgumentError(Exception):
|
class FunctionDefinitionError(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ def frontend(func: Callable[..., Any]) -> Callable[..., Any]:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
if function_has_arguments(func):
|
if function_has_arguments(func):
|
||||||
raise Exception(
|
raise FunctionDefinitionError(
|
||||||
"The @frontend decorator requires functions without arguments. Function "
|
"The @frontend decorator requires functions without arguments. Function "
|
||||||
f"'{func.__name__}' has at least one argument. "
|
f"'{func.__name__}' has at least one argument. "
|
||||||
"Please remove the argument(s) from this function to use it with the "
|
"Please remove the argument(s) from this function to use it with the "
|
||||||
@ -46,7 +46,7 @@ def frontend(func: Callable[..., Any]) -> Callable[..., Any]:
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Mark the function for frontend display.
|
# Mark the function for frontend display.
|
||||||
func._display_in_frontend = True
|
func._display_in_frontend = True # type: ignore
|
||||||
return func
|
return func
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user