문제

I have a class which extends SpiceRequest, but I need to call the onRequestFailure(SpiceException) method when a failure has occured in the loadDataFromNetwork() method. I tried to throw an exception inside that method but that doesn't fire the onRequestFailure(SpiceException) method.

How could I make this work?

도움이 되었습니까?

해결책

For sure something is wrong in your code, if you really throw an exception, it will be wrapped inside a SpiceException. Invoke spiceException.getCause() to get your original exception.

Check the logs, you should see that exception being processed inside RoboSpice. Maybe something wrong happens before with the cache, but normally the exception will be passed to the listener.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top