Dynamic result after error (List or Object)
<p>That's my first question, and I've researched but didnt find the answer...</p>

<p>I'm currently developing a REST Webservice using Resteasy. Its working fine but I've come to a doubt: there is a way to return a List OR a Object ?</p>

<p>Let me exemplify: I've got a method to return a LIST of SECTORS that is called after passing a token of authentication. 
If the token is OK - It should return the LIST of Sectors.
If the token is not OK - It should return an error which is mapped to a class called ErroGenerico that is an OBJECT.</p>

<p>How can I do that ? Return the OBJECT OR the LIST ?</p>