<commit_before>//
//  APIError.swift
//  Pods
//
//  Created by <NAME> on 12/26/16.
//
//

import Foundation

/// Errors that might happen in an API Call
public enum APIError: Error {
    case noData /// There's no underlying data
    case timeout /// Connection has timed out
    case cannotPerformRequest /// There's not enough information to perform the request
    case invalidResponse // Response isn't valid
    case invalidStatus(code: Int, data: Data?) /// The http status code represents an unsuccesfull transaction
    case invalidData(data: Data) /// The Data does not represent the expected information
    case mappingError(json: JSON) /// Failed mapping the JSON Object to the respective Deserializable object
    case unknown(error: Error) /// Another error ocurreda
    case generic(error: Error)
}

extension APIError: GenerizableError {
    
    public init(error: Error) {
        self = .generic(error: error)
    }
    <commit_msg>Removing unnecesary generic error case for api error<commit_after>//
//  APIError.swift
//  Pods
//
//  Created by <NAME> on 12/26/16.
//
//

import Foundation

/// Errors that might happen in an API Call
public enum APIError: Error {
    case noData /// There's no underlying data
    case timeout /// Connection has timed out
    case cannotPerformRequest /// There's not enough information to perform the request
    case invalidResponse // Response isn't valid
    case invalidStatus(code: Int, data: Data?) /// The http status code represents an unsuccesfull transaction
    case invalidData(data: Data) /// The Data does not represent the expected information
    case mappingError(json: JSON) /// Failed mapping the JSON Object to the respective Deserializable object
    case unknown(error: Error) /// Another error ocurred
}

extension APIError: GenerizableError {
    
    public init(error: Error) {
        self = .unknown(error: error)
    }
    
{'fraction_non_alphanumeric': 0.08738880167451596, 'fraction_numerical': 0.006279434850863423, 'mean_word_length': 3.0252631578947367, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '809633', 'n_tokens_mistral': 516, 'n_tokens_neox': 493, 'n_words': 212}