diff --git a/findmyorder/main.py b/findmyorder/main.py index e3678009..74d4a74a 100644 --- a/findmyorder/main.py +++ b/findmyorder/main.py @@ -146,12 +146,8 @@ async def identify_order( """ try: - matched_grammar_class = identify_grammar(my_string) - - if matched_grammar_class: - order = matched_grammar_class.define_grammar(my_string) - return order - + if matched_grammar_class := identify_grammar(my_string): + return matched_grammar_class.define_grammar(my_string) except Exception as error: logger.error(error) return error