Hi,
You can try like this way. Create a Activity step with multiple outcome. Use an activity step with Result Parameter with fixed domain values for success and error. Then populate the Result type as you wish, based on your code in the method . Also populate the multiline container. Then use it in workflow. Automatically multiple branch will create.
So whenever error occured in the method, you workflow will run that branch like exception. Also you can see the multiline contianer value.