Skip to content

Commit

Permalink
correct logic
Browse files Browse the repository at this point in the history
  • Loading branch information
drc38 authored Dec 9, 2024
1 parent 12b793c commit 5236f2b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ocpp/charge_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ def _raise_key_error(action, version):
from ocpp.v201.enums import Action as v201_Action

if version == "1.6":
try v16_Action(action):
try:
v16_Action(action)
raise NotImplementedError(
details={"cause": f"No handler for {action} registered."}
)
Expand All @@ -179,7 +180,8 @@ def _raise_key_error(action, version):
details={"cause": f"{action} not supported by OCPP{version}."}
)
elif version in ["2.0", "2.0.1"]:
try v201_Action(action):
try:
v201_Action(action)
raise NotImplementedError(
details={"cause": f"No handler for {action} registered."}
)
Expand Down

0 comments on commit 5236f2b

Please sign in to comment.