mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-19 12:59:36 +02:00
Potential fix for code scanning alert no. 21: 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:
parent
16840a6040
commit
af5be0bc8f
1 changed files with 6 additions and 2 deletions
|
@ -12,6 +12,8 @@ from adventures.models import AdventureImage
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
from django.shortcuts import get_object_or_404
|
from django.shortcuts import get_object_or_404
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
class IntegrationView(viewsets.ViewSet):
|
class IntegrationView(viewsets.ViewSet):
|
||||||
permission_classes = [IsAuthenticated]
|
permission_classes = [IsAuthenticated]
|
||||||
def list(self, request):
|
def list(self, request):
|
||||||
|
@ -420,9 +422,11 @@ class ImmichIntegrationViewSet(viewsets.ModelViewSet):
|
||||||
except requests.exceptions.SSLError:
|
except requests.exceptions.SSLError:
|
||||||
return False, original_server_url, "SSL certificate error - check server certificate"
|
return False, original_server_url, "SSL certificate error - check server certificate"
|
||||||
except requests.exceptions.RequestException as e:
|
except requests.exceptions.RequestException as e:
|
||||||
return False, original_server_url, f"Connection failed: {str(e)}"
|
logger.error(f"RequestException during Immich connection validation: {str(e)}")
|
||||||
|
return False, original_server_url, "Connection failed due to a network error."
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return False, original_server_url, f"Unexpected error: {str(e)}"
|
logger.error(f"Unexpected error during Immich connection validation: {str(e)}")
|
||||||
|
return False, original_server_url, "An unexpected error occurred while validating the connection."
|
||||||
|
|
||||||
# If we get here, none of the endpoints worked
|
# If we get here, none of the endpoints worked
|
||||||
return False, original_server_url, "Immich server endpoint not found - check server URL"
|
return False, original_server_url, "Immich server endpoint not found - check server URL"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue