Now, I want to be able to get token when I log in or get error message, for example if API message is: "User doesn't exist", so thats why I have my own Response class also with getToken() method.

Problem is, when error occurs (eg. user doesn't exist), I try to get error message as you can see in Login.java in handleError() but response is always null, probably because I am already in handleError.

I have checked this question, but I couldn't get it to work, because I don't understand how should I use onNext and other methods, or if it even fits for me, since I need to get token from the response.

Just as an example, here is a succesfull response, where id is my token: