File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828 MissingAPIKey ,
2929 MissingPreviousFunctionalitiesError ,
3030 MissingResource ,
31+ ModuleDoesNotExistError ,
3132 NetworkConnectionError ,
3233 OutdatedClientVersion ,
3334 PlainSyntaxError ,
@@ -318,6 +319,9 @@ def main(): # noqa: C901
318319 exc_info = sys .exc_info ()
319320 console .error (f"Connection error: { str (e )} \n " )
320321 console .error ("Please check that your internet connection is working." )
322+ except ModuleDoesNotExistError as e :
323+ exc_info = sys .exc_info ()
324+ console .error (f"Module does not exist: { str (e )} \n " )
321325 console .debug (f"Render ID: { run_state .render_id } " )
322326 except Exception as e :
323327 exc_info = sys .exc_info ()
Original file line number Diff line number Diff line change 1717import concept_utils
1818import file_utils
1919import plain_spec
20- from plain2code_exceptions import PlainSyntaxError
20+ from plain2code_exceptions import ModuleDoesNotExistError , PlainSyntaxError
2121from plain2code_nodes import Plain2CodeIncludeTag , Plain2CodeLoaderMixin
2222
2323RESOURCE_MARKER = "[resource]"
@@ -513,7 +513,7 @@ def parse_plain_source( # noqa: C901
513513def read_module_plain_source (module_name : str , template_dirs : list [str ]) -> str :
514514 plain_source_text = file_utils .open_from (template_dirs , module_name + PLAIN_SOURCE_FILE_EXTENSION )
515515 if plain_source_text is None :
516- raise PlainSyntaxError (f"Module does not exist ({ module_name } )." )
516+ raise ModuleDoesNotExistError (f"Module does not exist ({ module_name } )." )
517517 return plain_source_text
518518
519519
Original file line number Diff line number Diff line change 11import pytest
22
33import plain_file
4- from plain2code_exceptions import PlainSyntaxError
4+ from plain2code_exceptions import ModuleDoesNotExistError
55
66
77def test_non_existent_require (get_test_data_path ):
8- with pytest .raises (PlainSyntaxError , match = "Module does not exist" ):
8+ with pytest .raises (ModuleDoesNotExistError , match = "Module does not exist" ):
99 plain_file .plain_file_parser ("non_existent_require.plain" , [get_test_data_path ("data/requires" )])
1010
1111
You can’t perform that action at this time.
0 commit comments