Skip to content

Commit

Permalink
[BugFix] - Explicit error message when return type is not an OBBject (#…
Browse files Browse the repository at this point in the history
…6394)

* Send an explicit message when return type isn't an OBBject

* Update package_builder.py

Co-authored-by: montezdesousa <[email protected]>

* lint

---------

Co-authored-by: montezdesousa <[email protected]>
  • Loading branch information
IgorWounds and montezdesousa authored May 13, 2024
1 parent 4ed5f05 commit 10dddfd
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ def get_function_hint_type_list(cls, func: Callable) -> List[Type]:
hint_type_list.append(parameter.annotation)

if return_type:
if not issubclass(return_type, OBBject):
raise ValueError("Return type must be an OBBject.")
hint_type = get_args(get_type_hints(return_type)["results"])[0]
hint_type_list.append(hint_type)

Expand Down

0 comments on commit 10dddfd

Please sign in to comment.