Show notification from middleware (core)

HI. Currently I’m using

> throw RuntimeException("message");

Are there something more suitable?

My goal is to show a Notification if something goes wrong at onBeforeInsert and abort insert process


It is impossible to show notification directly from the middleware due to distributed architecture of the platform.

There is more convenient exception for your task: For instance, It will be passed to REST-API clients as JSON object with message.

Also, you could introduce your own business exceptions and implement exception handlers for them:

1 Like


Actually, some minutes after post, I thought just the same thing. No sense to launch Dialogs from middlewar.