In OData, $expand allows providing multiple entities and/or entity sets as a response to a single service call. Although the SAP Gateway framework can handle expands out of the box, implementing custom logic is recommended for performance reasons.
It is generally best practice to create global exception classes. That said, a handy but not so well-known option is to define a local exception class inside a global class. These allow internal exceptions to be handled without the need for another global DDIC object.