File tree Expand file tree Collapse file tree 2 files changed +21
-10
lines changed
Expand file tree Collapse file tree 2 files changed +21
-10
lines changed Original file line number Diff line number Diff line change @@ -39,8 +39,12 @@ def _create_files_list(self, parsers: List[Parser]):
3939
4040 for p in parsers :
4141 functions = []
42- for doc in p .extract_documentation ():
43- functions .append (documentation_to_specification (doc ))
42+ for i , doc in enumerate (p .extract_documentation ()):
43+ try :
44+ functions .append (documentation_to_specification (doc ))
45+ except Exception as e :
46+ logger .error (f"Error while parsing documentation block no { i + 1 } inside { p .filename } " )
47+ raise e
4448
4549 base = os .path .splitext (os .path .basename (p .filename ))[0 ]
4650 if base in registered :
Original file line number Diff line number Diff line change @@ -115,11 +115,18 @@ def from_txt(doc: Documentation) -> spec.Function:
115115
116116
117117def documentation_to_specification (doc : Documentation ) -> spec .Function :
118- if doc .source == Source .ArkScript :
119- return from_ark (doc )
120- elif doc .source == Source .Cpp :
121- return from_cpp (doc )
122- elif doc .source == Source .Txt :
123- return from_txt (doc )
124- else :
125- raise NotImplementedError
118+ try :
119+ if doc .source == Source .ArkScript :
120+ return from_ark (doc )
121+ elif doc .source == Source .Cpp :
122+ return from_cpp (doc )
123+ elif doc .source == Source .Txt :
124+ return from_txt (doc )
125+ except ValueError as e :
126+ logger .error (f"While parsing file a { doc .source } , got an error" )
127+ try :
128+ logger .error (str (doc ))
129+ except Exception :
130+ logger .warn ("Couldn't print the signature of the function" )
131+ raise e
132+ raise NotImplementedError
You can’t perform that action at this time.
0 commit comments