guest docs: log errors
All checks were successful
build-and-deploy / build-deploy (push) Successful in 32s

This commit is contained in:
androidlover5842
2026-01-31 10:54:33 +05:30
parent e148549b6c
commit 1d1cb9c040

View File

@@ -31,6 +31,7 @@ import java.nio.file.Files
import java.nio.file.Paths
import java.util.UUID
import java.security.MessageDigest
import org.slf4j.LoggerFactory
@RestController
@RequestMapping("/properties/{propertyId}/guests/{guestId}/documents")
@@ -52,6 +53,7 @@ class GuestDocuments(
@org.springframework.beans.factory.annotation.Value("\${storage.documents.aiBaseUrl:\${storage.documents.publicBaseUrl}}")
private val aiBaseUrl: String
) {
private val logger = LoggerFactory.getLogger(GuestDocuments::class.java)
@PostMapping
@ResponseStatus(HttpStatus.CREATED)
@@ -220,8 +222,8 @@ class GuestDocuments(
document.extractedAt = OffsetDateTime.now()
guestDocumentRepo.save(document)
guestDocumentEvents.emit(propertyId, guestId)
} catch (_: Exception) {
// Keep upload successful even if AI extraction fails.
} catch (ex: Exception) {
logger.warn("Document extraction failed for documentId={}", document.id, ex)
}
}
}