When an unhandled exception occurs, publishing a custom platform event using EventBus.publish() method is the appropriate way. The external system can then subscribe to this event using technologies like CometD to receive notifications. References: Publish and Subscribe to Platform Events