Born before Internet, started as "webmaster", now supporting people mastering it.
I was shaped by XP methodology & DDD architectures. Open source enthusiast.
When dealing with a sync command (no rabbitmq etc) I favor intercepting exception directly in the controller, I don't have access to code right now, but something like this, should work:
class MyController
{
public function xxx()
{
try {
$this->bus->dispatch($command);
} catch ( exception )
// rethrow with appropriate HTTP error code
}
}
}
Hi, welcome to backend dev ! I'll hope you will have a rich journey there :)
What you are mentioning is actually a pattern: notification.
Martin Fowler wrote about it there: martinfowler.com/articles/replaceT...
When dealing with a sync command (no rabbitmq etc) I favor intercepting exception directly in the controller, I don't have access to code right now, but something like this, should work:
Thanks for your help. ;)