Class ErrorHandlingAdapterFactory

  • All Implemented Interfaces:

    
    public final class ErrorHandlingAdapterFactory
    
                        

    A CallAdapter.Factory that will throw proper CauseException exceptions on all retrofit calls.

    • If a call fails due to network issues, it throws NoNetworkException

    • If a call falls due to bad JSON parsing, it throws DataParsingException

    • If a call fails due to bad response, it calls supplied errorHandler to parse error response and returns CauseException supplied from that handler

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      <Error class: unknown class><out <Error class: unknown class>, out <Error class: unknown class>> ,kotlin.Array,.)>get(<Error class: unknown class> returnType, Array<Annotation> annotations, <Error class: unknown class> retrofit)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ErrorHandlingAdapterFactory

        ErrorHandlingAdapterFactory(<Error class: unknown class> coroutineScope, ErrorHandler errorHandler)
        Parameters:
        coroutineScope - A coroutine scope that all calls will be started on this scope.
        errorHandler - Error handler that parses the error responses
    • Method Detail

      • get

         <Error class: unknown class><out <Error class: unknown class>, out <Error class: unknown class>> ,kotlin.Array,.)>get(<Error class: unknown class> returnType, Array<Annotation> annotations, <Error class: unknown class> retrofit)