Add additional log messages for 4xx responses

This commit is contained in:
Alan Grainger
2025-10-11 13:37:05 +08:00
parent 18bf03239f
commit c23de6331d
6 changed files with 19 additions and 20 deletions
+3 -5
View File
@@ -59,8 +59,7 @@ class Immich {
// Check that the key is a valid format
if (!immich.isKey(request.key)) {
log('Wrong key format ' + request.key)
respondToInvalidRequest(res, 404)
respondToInvalidRequest(res, 404, 'Wrong key format ' + request.key)
return
}
@@ -68,7 +67,7 @@ class Immich {
const sharedLinkRes = await immich.getShareByKey(request.key, request.password, request.keyType || KeyType.key)
if (!sharedLinkRes.valid) {
// This isn't a valid request - check the console for more information
respondToInvalidRequest(res, 404)
respondToInvalidRequest(res, 404, 'Invalid request')
return
}
@@ -100,8 +99,7 @@ class Immich {
}
if (!sharedLinkRes.link) {
log('Unknown error with key ' + request.key)
respondToInvalidRequest(res, 404)
respondToInvalidRequest(res, 404, 'Unknown error with key ' + request.key)
return
}
const link = sharedLinkRes.link