title: RxJava and Retrofit - Raising custom exceptions depending on server response
body: <p>I would like Retrofit to raise custom exceptions depending on the server response. For example in the following structure:</p>
  
  <pre><code>{
  "code":0,
  "message":"OK",
  "data":{....}
  }
  </code></pre>
  
  <p>I would like to raise an exception for subscribers if <code>code</code> is anything other than 0. How is it possible using Retrofit and Rx? I would much prefer to write this logic only once and have it applied to all observables returned by retrofit.</p>