Skip to content

Commit

Permalink
add text to autopygen exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
bernt-matthias committed Apr 9, 2024
1 parent 28b2ca4 commit 6153f24
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def visit_ImportFrom(self, node: ast.ImportFrom) -> Any:

def report_findings(self) -> Tuple[List[ast.AST], Optional[str], Optional[str], Set[str]]:
if self.argparse_module_alias is None and self.argument_parser_alias is None:
raise ArgParseImportNotFound()
raise ArgParseImportNotFound("No argparse import found")

return (self.actions, self.argparse_module_alias, self.argument_parser_alias, self.known_names)

Expand Down Expand Up @@ -165,7 +165,7 @@ def _replace_parser(self, node: ast.Assign, imported_using_from: bool):

def report_findings(self) -> Tuple:
if self.main_parser_name is None:
raise ArgParserNotUsed
raise ArgParserNotUsed("Atgument parser not used")

return self.actions, self.main_parser_name

Expand Down Expand Up @@ -243,7 +243,7 @@ def get_parser_init_and_actions(source: ast.Module) -> Tuple[List[ast.AST], str,
custom_parser_class_def = obtain_class_def()

if custom_parser_class_def is None:
raise CustomParserUnavailableException()
raise CustomParserUnavailableException("Custom parser unavailable")

import_discovery = ImportDiscovery(actions)
actions, argparse_module_alias, argparse_class_alias, known_names = import_discovery.visit_and_report(source)
Expand Down

0 comments on commit 6153f24

Please sign in to comment.