mirror of
https://github.com/tiqi-group/pydase.git
synced 2026-01-23 20:24:20 +01:00
changes exception raised by @frontend decorator
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user