Skip to content

Commit

Permalink
use new type error from typeguard
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Gesel <[email protected]>
  • Loading branch information
pac48 committed Aug 2, 2024
1 parent 5c534d6 commit 03f753c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
fail-fast: false
matrix:
env:
# Werror is not enabled on humble and iron because of gtest
- ROS_DISTRO: rolling
ROS_REPO: testing
- ROS_DISTRO: rolling
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@

from jinja2 import Template, Environment
from typeguard import typechecked

try:
from typeguard import TypeCheckError
except:
TypeCheckError = TypeError

from typing import Any, List, Optional
from yaml.parser import ParserError
from yaml.scanner import ScannerError
Expand Down Expand Up @@ -190,7 +196,7 @@ def __init__(
func = self.conversation.lang_str_value_func[self.defined_type]
try:
self.lang_str_value = func(default_value)
except TypeError:
except TypeCheckError:
raise compile_error(
f'Parameter {param_name} has incorrect type. Expected: {defined_type}, got: {self.get_yaml_type_from_python(default_value)}'
)
Expand Down

0 comments on commit 03f753c

Please sign in to comment.