mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-03 04:22:09 +08:00
handle conversion exception for LongitudinalPersonality (#28426)
* handle type conversion exception * catch multiple exception old-commit-hash: 48b507c0b4508171c1439e05344e6cb0f8672d12
This commit is contained in:
@@ -65,10 +65,9 @@ class LongitudinalPlanner:
|
||||
self.personality = log.LongitudinalPersonality.standard
|
||||
|
||||
def read_param(self):
|
||||
param_value = self.params.get('LongitudinalPersonality')
|
||||
if param_value is not None:
|
||||
self.personality = int(param_value)
|
||||
else:
|
||||
try:
|
||||
self.personality = int(self.params.get('LongitudinalPersonality'))
|
||||
except (ValueError, TypeError):
|
||||
self.personality = log.LongitudinalPersonality.standard
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user