<br><br><div class="gmail_quote">On Thu, May 10, 2012 at 4:20 PM, Mauricio Salatino <span dir="ltr">&lt;<a href="mailto:salaboy@gmail.com" target="_blank">salaboy@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi guys, <div>I was reviewing the Human Task Module and more specifically the HornetQ implementation. </div><div>I was writing some tests to check the behavior after a logical failure in the server side and I reach a point where some design questions appear:</div>


<div><br></div><div>The following line tries to start a task which doesn&#39;t exist in the server:</div><div><br></div><div>client.start(3, &quot;&quot;);</div><div><br></div><div>Where client is -&gt; TaskService.</div>


<div><br></div><div>This leads to a Runtime Exception in the client side with a clear message: </div><div>&quot;Command OperationRequest faild due to No Task with ID 3 was found!. Please contact task server administrator.&quot;  &lt;-- not sure about the administrator part</div>


<div><br></div><div>I understand that we are throwing a Runtime Exception to be able to not declare the exception inside the TaskService interface, but...</div><div>For real implementations the user will be forced to do the following:</div>


<div><br></div><div><div>      try{</div><div>            client.start(3, &quot;&quot;);</div><div>        }catch(Exception e){</div><div>              assertEquals(&quot;Command OperationRequest faild due to No Task with ID 3 was found!. Please contact task server administrator.&quot;, e.getMessage());</div>


<div>              // or notify the UI about the error using that message.</div><div>        }</div></div><div>No matter the method that the user calls in the client UIs the try/catch block will need to be included in order to not break the app.</div>


<div>So my question is: we already have the TaskException class which extends RuntimeException, there are not too many implementations, but we surely can add</div><div>the TaskPersistence exception, logical exceptions, etc. </div>


<div>In my perspective adding the exception to both interfaces (TaskService and AsyncTaskService) will provide a more clear approach to the users that in the end will</div><div>need to add the try catch no matter why. </div>


<div><br></div><div>In my opinion, this is just the first step of providing our clients a way to notify the errors to their UIs.</div><div><br></div><div>Looking forward for your comments and feedback! </div><div><br></div>


<div>Cheers</div><span class="HOEnZb"><font color="#888888"><div><div><br></div>-- <br> - MyJourney @ <a href="http://salaboy.wordpress.com" target="_blank">http://salaboy.wordpress.com</a><div> - Co-Founder @ <a href="http://www.jugargentina.org" target="_blank">http://www.jugargentina.org</a><br>


 - Co-Founder @ <a href="http://www.jbug.com.ar" target="_blank">http://www.jbug.com.ar</a><br> <br> - Salatino &quot;Salaboy&quot; Mauricio -</div><br>
</div>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br> - MyJourney @ <a href="http://salaboy.wordpress.com" target="_blank">http://salaboy.wordpress.com</a><div> - Co-Founder @ <a href="http://www.jugargentina.org" target="_blank">http://www.jugargentina.org</a><br>

 - Co-Founder @ <a href="http://www.jbug.com.ar" target="_blank">http://www.jbug.com.ar</a><br> <br> - Salatino &quot;Salaboy&quot; Mauricio -</div><br>