<commit_before>package com.joker.fourfun.net;

import io.reactivex.functions.Function;

/**
 * Created by joker on 2016/11/28.
 */

public class HttpResultFun<T> implements Function<HttpResult<T>, T> {
    @Override
    public T apply(HttpResult<T> tHttpResult) throws Exception {
        if (tHttpResult.isError()) {
            throw new ApiException(ApiException.MESSAGE_NOT_FOUND);
        }

        return tHttpResult.getResult();
    }
}<commit_msg>add exception type<commit_after>package com.joker.fourfun.net;

import io.reactivex.functions.Function;

/**
 * Created by joker on 2016/11/28.
 */

public class HttpResultFun<T> implements Function<HttpResult<T>, T> {
    @Override
    public T apply(HttpResult<T> tHttpResult) throws Exception {
        if (tHttpResult == null) {
            throw new ConnectErrorException(ConnectErrorException.TIME_OUT_ERROR);
        }

        if (tHttpResult.isError()) {
            throw new ApiException(ApiException.MESSAGE_NOT_FOUND);
        }

        return tHttpResult.getResult();
    }
}
{'fraction_non_alphanumeric': 0.10707456978967496, 'fraction_numerical': 0.015296367112810707, 'mean_word_length': 3.1547619047619047, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3317904', 'n_tokens_mistral': 330, 'n_tokens_neox': 313, 'n_words': 66}