diff --git a/core/rosmaster/src/rosmaster/master_api.py b/core/rosmaster/src/rosmaster/master_api.py index 2c168471..9a5ce501 100644 --- a/core/rosmaster/src/rosmaster/master_api.py +++ b/core/rosmaster/src/rosmaster/master_api.py @@ -148,8 +148,8 @@ def apivalidate(error_return_value, validators=()): try: newArgs.append(v(a, caller_id)) except ParameterInvalid, e: - _logger.error("%s: invalid parameter: %s", f.func_name, e.message or 'error') - return -1, e.message or 'error', error_return_value + _logger.error("%s: invalid parameter: %s", f.func_name, str(e) or 'error') + return -1, str(e) or 'error', error_return_value else: newArgs.append(a) diff --git a/core/rosmaster/src/rosmaster/validators.py b/core/rosmaster/src/rosmaster/validators.py index 0dd156a7..62431728 100644 --- a/core/rosmaster/src/rosmaster/validators.py +++ b/core/rosmaster/src/rosmaster/validators.py @@ -41,10 +41,10 @@ ROSRPC = "rosrpc://" class ParameterInvalid(Exception): """Exception that is raised when a parameter fails validation checks""" def __init__(self, message): - self.message = message + self._message = message def __str__(self): - return str(self.message) + return str(self._message) def non_empty(param_name): """Validator that checks that parameter is not empty"""