API: Upload new version of an extension #138

Merged
Dalai Felinto merged 12 commits from tokens-version-api into main 2024-05-27 16:18:05 +02:00
Showing only changes of commit 1baf3b9bb8 - Show all commits

View File

@ -197,7 +197,6 @@ class UploadExtensionVersionView(APIView):
status=status.HTTP_403_FORBIDDEN,
)
Oleg-Komarov marked this conversation as resolved Outdated

could we avoid this big try-except? what is the default drf error behavior?
we need to make sure that we are not leaking any error details in production - we will have the exception logged via sentry, and api users can't do anything useful with those details

could we avoid this big try-except? what is the default drf error behavior? we need to make sure that we are not leaking any error details in production - we will have the exception logged via sentry, and api users can't do anything useful with those details
try:
# Create a NewVersionView instance to handle file creation
new_version_view = NewVersionView(request=request, extension=extension)
@ -231,10 +230,3 @@ class UploadExtensionVersionView(APIView):
},
status=status.HTTP_201_CREATED,
)
except Exception as e:
return Response(
{
'message': str(e),
},
status=status.HTTP_500_INTERNAL_SERVER_ERROR,
)