1
0
Fork 0
mirror of https://github.com/alangrainger/immich-public-proxy.git synced 2024-12-28 03:41:58 +00:00

Add debug logging for unknown error

This commit is contained in:
Alan Grainger 2024-11-15 18:19:32 +01:00
parent f9123e8a04
commit fb093185d9

View file

@ -130,7 +130,7 @@ class Immich {
password password
}) })
const res = await fetch(url) const res = await fetch(url)
if ((res.headers.get('Content-Type') || '').includes('application/json')) { if ((res.headers.get('Content-Type') || '').toLowerCase().includes('application/json')) {
const jsonBody = await res.json() const jsonBody = await res.json()
if (jsonBody) { if (jsonBody) {
if (res.status === 200) { if (res.status === 200) {
@ -164,6 +164,7 @@ class Immich {
// Otherwise return failure // Otherwise return failure
log('Immich response ' + res.status + ' for key ' + key) log('Immich response ' + res.status + ' for key ' + key)
try { try {
console.log(res.headers.get('Content-Type'))
console.log((await res.text()).slice(0, 500)) console.log((await res.text()).slice(0, 500))
} catch (e) { } catch (e) {
console.log(e) console.log(e)