Skip to content
This repository was archived by the owner on Aug 28, 2020. It is now read-only.

Commit 024b619

Browse files
committed
see if index file exists after starting a debugging session to validate path mapping
1 parent e3cffeb commit 024b619

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

pugdebug/pugdebug.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -298,14 +298,6 @@ def open_document(self, path, map_paths=True):
298298

299299
path = self.__get_path_mapped_to_local(path, map_paths)
300300

301-
if path is False:
302-
self.handle_error(
303-
"File does not exist after mapping. "
304-
"Is the path map correct?"
305-
)
306-
self.stop_debug()
307-
return
308-
309301
if not self.documents.is_document_open(path):
310302
document_model = self.documents.open_document(path)
311303

@@ -492,6 +484,18 @@ def handle_debugging_started(self):
492484

493485
self.main_window.toggle_actions(True)
494486

487+
# Check if path to index file is correct after mapping it
488+
index_file = self.debugger.get_index_file()
489+
path = self.__get_path_mapped_to_local(index_file)
490+
491+
if path is False:
492+
self.handle_error(
493+
"File does not exist after mapping. "
494+
"Is the path map correct?"
495+
)
496+
self.stop_debug()
497+
return
498+
495499
post_start_data = {
496500
'init_breakpoints': self.init_breakpoints
497501
}

0 commit comments

Comments
 (0)