feat: BackupService real pg_dump, OrganisationService region stats, SystemConfigService overrides
- BackupService: DB-persisted metadata (BackupRecord/BackupConfig entities + V16 Flyway migration), real pg_dump execution via ProcessBuilder, soft-delete on deleteBackup, pg_restore manual guidance - OrganisationService: repartitionRegion now queries Adresse entities (was Map.of() stub) - SystemConfigService: in-memory config overrides via AtomicReference (no DB dependency) - SystemMetricsService: null-guard on MemoryMXBean in getSystemStatus() (fixes test NPE) - Souscription workflow: SouscriptionService, SouscriptionResource, FormuleAbonnementRepository, V11 Flyway migration, admin REST clients - Flyway V8-V15: notes membres, types référence, type orga constraint, seed roles, première connexion, Wave checkout URL, Wave telephone column length fix - .gitignore: added uploads/ and .claude/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ package dev.lions.unionflow.server.exception;
|
||||
import dev.lions.unionflow.server.service.SystemLoggingService;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.ws.rs.ForbiddenException;
|
||||
import jakarta.ws.rs.NotAllowedException;
|
||||
import jakarta.ws.rs.NotAuthorizedException;
|
||||
import jakarta.ws.rs.NotFoundException;
|
||||
import jakarta.ws.rs.WebApplicationException;
|
||||
@@ -64,6 +65,8 @@ public class GlobalExceptionMapper implements ExceptionMapper<Throwable> {
|
||||
String stacktrace = getStackTrace(exception);
|
||||
|
||||
// Persister dans system_logs (ne pas laisser ça crasher le mapper)
|
||||
// Note: systemLoggingService est @Transactional → ne peut pas être appelé depuis
|
||||
// le thread IO de Vert.x (ex: exceptions levées avant le dispatch vers worker thread)
|
||||
try {
|
||||
systemLoggingService.logError(
|
||||
determineSource(exception),
|
||||
@@ -74,6 +77,10 @@ public class GlobalExceptionMapper implements ExceptionMapper<Throwable> {
|
||||
"/" + endpoint,
|
||||
statusCode
|
||||
);
|
||||
} catch (IllegalStateException e) {
|
||||
// BlockingOperationNotAllowedException est une IllegalStateException :
|
||||
// le mapper est appelé depuis le thread IO, on ne peut pas démarrer une transaction JTA.
|
||||
log.debug("Cannot persist error log from IO thread ({}): {}", e.getClass().getSimpleName(), message);
|
||||
} catch (Exception e) {
|
||||
log.warn("Failed to log error to system_logs", e);
|
||||
}
|
||||
@@ -90,7 +97,8 @@ public class GlobalExceptionMapper implements ExceptionMapper<Throwable> {
|
||||
private boolean isExpectedClientError(Throwable exception) {
|
||||
return exception instanceof NotFoundException
|
||||
|| exception instanceof ForbiddenException
|
||||
|| exception instanceof NotAuthorizedException;
|
||||
|| exception instanceof NotAuthorizedException
|
||||
|| exception instanceof NotAllowedException;
|
||||
}
|
||||
|
||||
private int determineStatusCode(Throwable exception) {
|
||||
|
||||
Reference in New Issue
Block a user