Skip to content Skip to sidebar Skip to footer

Throw Exceptions Through Several Processes

I have Remote Service in a separate process and in this Remote Service for example I am calling a method that throw Custom Runtime Exception if something wrong. - I want to handle

Solution 1:

I think you can but it is not so easy. To do this you should manually realize IPC communication between your service and activity. I.e. you should make an your Interface that extends IInterface. After that you should manually realize Stub and Proxy classes for this interface. And in this classes you should manually realize communication between this proxy and stub classes (i.e. here you can send exceptions between processes).

I think that it's easier to send for instance integer in your case. And in Activity just check this integer value. If it is equal to predefined value, you can throw your Custom Runtime Exception.

Post a Comment for "Throw Exceptions Through Several Processes"