1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-08-05 05:05:17 +02:00

Potential fix for code scanning alert no. 29: Information exposure through an exception

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
Sean Morley 2025-06-25 11:55:54 -04:00 committed by GitHub
parent 015bd64c14
commit c58dc726f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -320,7 +320,9 @@ class BackupViewSet(viewsets.ViewSet):
return Response({'error': 'Invalid JSON in backup file'},
status=status.HTTP_400_BAD_REQUEST)
except Exception as e:
return Response({'error': f'Import failed: {str(e)}'},
import logging
logging.error("Import failed", exc_info=True)
return Response({'error': 'An internal error occurred during import'},
status=status.HTTP_400_BAD_REQUEST)
finally:
os.unlink(tmp_file_path)