Skip to content

Commit

Permalink
tech: add error log on use-case exception
Browse files Browse the repository at this point in the history
  • Loading branch information
maximeperrault committed Jan 6, 2025
1 parent dadcde4 commit bdffc3d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import fr.gouv.cacem.monitorenv.domain.exceptions.BackendInternalException
import fr.gouv.cacem.monitorenv.domain.exceptions.BackendUsageErrorCode
import fr.gouv.cacem.monitorenv.domain.exceptions.BackendUsageException
import fr.gouv.cacem.monitorenv.domain.exceptions.ReportingAlreadyAttachedException
import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs.*
import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs.ApiError
import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs.BackendInternalErrorDataOutput
import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs.BackendRequestErrorDataOutput
import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs.BackendUsageErrorDataOutput
import fr.gouv.cacem.monitorenv.infrastructure.api.adapters.bff.outputs.MissingParameterApiError
import fr.gouv.cacem.monitorenv.infrastructure.exceptions.BackendRequestErrorCode
import fr.gouv.cacem.monitorenv.infrastructure.exceptions.BackendRequestException
import org.locationtech.jts.io.ParseException
Expand Down Expand Up @@ -43,6 +47,7 @@ class ControllersExceptionHandler {
@ResponseStatus(HttpStatus.BAD_REQUEST)
@ExceptionHandler(BackendUsageException::class)
fun handleBackendUsageException(e: BackendUsageException): BackendUsageErrorDataOutput {
logger.error(e.message)
return BackendUsageErrorDataOutput(code = e.code, data = e.data, message = null)
}

Expand Down

0 comments on commit bdffc3d

Please sign in to comment.