Skip to content

Commit

Permalink
Storage: Don't raise NotDirectory error, raise APIException w/ message
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Puerto committed May 15, 2024
1 parent cd34b62 commit 8a4103c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import shutil

from django.forms import model_to_dict
from rest_framework.exceptions import APIException

from user_workspaces_server.controllers.storagemethods.abstract_storage import (
AbstractStorage,
Expand Down Expand Up @@ -128,7 +129,7 @@ def create_symlink(self, path, symlink):
os.remove(os.path.join(symlink_full_dest_path, symlink_name))
os.symlink(symlink_source_path, os.path.join(symlink_full_dest_path, symlink_name))
else:
raise NotADirectoryError
raise APIException(f"Symlink path not found: {symlink_source_path}")

def create_file(self, path, file):
file_path_list = file.name.split("/")
Expand Down

0 comments on commit 8a4103c

Please sign in to comment.