Symfony 3.4 and Doctrine events - is it possible to redirect the user if an exception is thrown?

Symfony 3.4 and Doctrine events - is it possible to redirect the user if an exception is thrown?

I'm building an e-commerce site that talks to Stripe's API during a set of&nbsp;prePersist,&nbsp;preUpdate, and&nbsp;preRemove&nbsp;Doctrine events. Unfortunately, the&nbsp;<a href="https://symfony.com/doc/3.4/event_dispatcher.html" target="_blank">documentation for Symfony events</a>&nbsp;doesn't really have anything on error/exception handling within events.

I'm building an e-commerce site that talks to Stripe's API during a set of prePersist, preUpdate, and preRemove Doctrine events. Unfortunately, the documentation for Symfony events doesn't really have anything on error/exception handling within events.

Ideally, I'd log the exception, and then redirect the user to a safe route (maybe the one that dispatched the event, or maybe a catch-all error page) with a relevant error message (flash message). Is that possible? If so, how would I do that from within an event?

python symfony

What's new in Bootstrap 5 and when Bootstrap 5 release date?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Random Password Generator Online

HTML Color Picker online | HEX Color Picker | RGB Color Picker

Basic Data Types in Python | Python Web Development For Beginners

In the programming world, Data types play an important role. Each Variable is stored in different data types and responsible for various functions. Python had two different objects, and They are mutable and immutable objects.

Top Python Development Companies | Hire Python Developers

After analyzing clients and market requirements, TopDevelopers has come up with the list of the best Python service providers. These top-rated Python developers are widely appreciated for their professionalism in handling diverse projects. When...

Python Hello World Program - Create & Run Your First Python Program in PyCharm

Python Hello World Program - Your first step towards Python world. Learn how to create the Hello World Python program in PyCharm.

Standard Data Types in Python - Python Tutorial - Python Training

This video on 'Standard Data Types in Python' will help you establish a foothold on Python by helping you learn basic concepts.

Python Libraries You Must Learn in 2020-Learn Python-Python Training

This LIVE session on 'Python Libraries' will help you understand the topmost trending Python libraries toy must learn.