// Path: rxuploader/src/main/java/com/jagsaund/rxuploader/job/ErrorType.java
// public enum ErrorType {
//     NETWORK("network"),
//     FILE_NOT_FOUND("file_not_found"),
//     SERVICE("service"),
//     TERMINATED("terminated"),
//     UNKNOWN("unknown");
// 
//     @NonNull private final String type;
// 
//     ErrorType(@NonNull String type) {
//         this.type = type;
//     }
// 
//     @NonNull
//     @Override
//     public String toString() {
//         return "ErrorType: " + type;
//     }
// }


import android.support.annotation.NonNull;
import com.jagsaund.rxuploader.job.ErrorType;
package com.jagsaund.rxuploader;


/**
 * Defines how the {@link Uploader} should handle errors. This includes mapping {@link Throwable} to
 * {@link ErrorType} and determining which errors can be retried.
 */
public interface UploadErrorAdapter {
    /**
     * Maps {@link Throwable} to an {@link ErrorType}.
     *
     * @param error The error to map from
     * @return an {@link ErrorType} representing the received {@code error}
     */
    @NonNull
// Path: rxuploader/src/main/java/com/jagsaund/rxuploader/job/ErrorType.java
// public enum ErrorType {
//     NETWORK("network"),
//     FILE_NOT_FOUND("file_not_found"),
//     SERVICE("service"),
//     TERMINATED("terminated"),
//     UNKNOWN("unknown");
// 
//     @NonNull private final String type;
// 
//     ErrorType(@NonNull String type) {
//         this.type = type;
//     }
// 
//     @NonNull
//     @Override
//     public String toString() {
//         return "ErrorType: " + type;
//     }
// }


// Path: rxuploader/src/main/java/com/jagsaund/rxuploader/UploadErrorAdapter.java
import android.support.annotation.NonNull;
import com.jagsaund.rxuploader.job.ErrorType;

package com.jagsaund.rxuploader;


/**
 * Defines how the {@link Uploader} should handle errors. This includes mapping {@link Throwable} to
 * {@link ErrorType} and determining which errors can be retried.
 */
public interface UploadErrorAdapter {
    /**
     * Maps {@link Throwable} to an {@link ErrorType}.
     *
     * @param error The error to map from
     * @return an {@link ErrorType} representing the received {@code error}
     */
    @NonNull
    ErrorType fromThrowable(@NonNull Throwable error);