<commit_before>//
//  APIError.swift
//  Rocket.Chat
//
//  Created by <NAME> on 11/27/17.
//  Copyright © 2017 Rocket.Chat. All rights reserved.
//

import Foundation

typealias APIErrored = (APIError) -> Void

enum APIError {
    case version(available: Version, required: Version)
    case error(Error)
    case noData
    case malformedRequest
}<commit_msg>Show localizedDescription in share extension when error happens<commit_after>//
//  APIError.swift
//  Rocket.Chat
//
//  Created by <NAME> on 11/27/17.
//  Copyright © 2017 Rocket.Chat. All rights reserved.
//

import Foundation

typealias APIErrored = (APIError) -> Void

enum APIError: CustomStringConvertible {
    case version(available: Version, required: Version)
    case error(Error)
    case noData
    case malformedRequest

    var description: String {
        switch self {
        case .error(let error):
            return error.localizedDescription
        default:
            return "\(self)"
        }
    }
}
{'fraction_non_alphanumeric': 0.10202020202020202, 'fraction_numerical': 0.020202020202020204, 'mean_word_length': 2.6433823529411766, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '4414869', 'n_tokens_mistral': 312, 'n_tokens_neox': 286, 'n_words': 89}