Skip to Content
1
Jul 05, 2022 at 06:19 AM

How to catch exception in mt subscription event

204 Views

Is there any method to catch the exception when mt subscription is failed?

I notice that there's a log like:

OUT { "written_at":"*****","written_ts":*****,"tenant_id":"-","component_id":"*****","component_name":"*****","organization_name":"*****","component_type":"*****","space_name":"*****","component_instance":"*****","organization_id":"*****","correlation_id":"*****","space_id":"*****","container_id":"*****","tenant_subdomain":"-","type":"log","logger":"com.sap.cds.services.impl.runtime.CdsRuntimeImpl","thread":"qtp65838989-19","level":"INFO","categories":[],"msg":"Exception marked the ChangeSet 898 as cancelled: Failed to process subscription of tenant '*****' (service 'MtSubscriptionService$Default', event 'SUBSCRIBE', entity '<no entity>')" }

I don not override the @On for EVENT_SUBSCRIBE, and I can get into the @After for it only if the subscription succeeds.

But I need to handle the exception when subscription fails, how can I make it?