Skip to content

Commit

Permalink
handle OS errors
Browse files Browse the repository at this point in the history
  • Loading branch information
predragnikolic committed Jul 3, 2024
1 parent 1ae7ec4 commit 6181644
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugin/rename_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ def rename_path(self, old_path: str, new_path: str) -> None:
if not os.path.exists(new_dir):
os.makedirs(new_dir)
isdir = os.path.isdir(old_path)
os.rename(old_path, new_path)
try:
os.rename(old_path, new_path)
except:
sublime.status_message("Unable to rename")
if isdir:
for v in self.window.views():
file_name = v.file_name()
Expand Down

0 comments on commit 6181644

Please sign in to comment.