Mulesoft redesigned the whole error handling mechanism and components in Mule 4 (some key difference here). In Mule 3, there was a simple way to reuse a flow across multiple applications by putting into a separate mule-application and package that as jar. Jar can be added as a dependency in any mule-application. An important application of this was having a reusable error response builder flow that possibly analyzes the exception and generates client friendly error response with the proper error code and error message for the REST API client.
However, Mule 4 does it a slightly different way. For reusing a flow, we need to create a Mule plugin and put the flow into that plugin. Any mule-application can add that plugin as maven dependency and reusable flow can be shared.
This article gives a step-by-step guide to generate that plugin in Mule 4 and installing into any mule-application.