<commit_before>//
//  SalesforceError.swift
//  SwiftlySalesforce
//
//  For license & details see: https://www.github.com/mike4aday/SwiftlySalesforce
//  Copyright (c) 2016. All rights reserved.
//

public enum SalesforceError: Error {
	case userAuthenticationRequired
	case invalidity(message: String)
	case unsupportedURL(url: URL)
	case responseFailure(code: String, message: String, fields: [String]?)
	case jsonDeserializationFailure(elementName: String?, json: Any)
	case serverFailure
}

extension SalesforceError: CustomDebugStringConvertible {
	
	public var debugDescription: String {
		switch self {
		case .userAuthenticationRequired:
			return "User authentication required"
		case let .invalidity(message):
			return "Invalid: \(message)"
		case let .unsupportedURL(url):
			return "Unsupported URL: \(url.absoluteString)"
		case let .responseFailure(code, message, fields):
			return "Salesforce response failure. Code: \(code). Message: \(message). Fields: \(fields ?? [])"
		default:
			return "\(self)"
		}
	}
}<commit_msg>Added explicit case for all enum members in debugDescription; removed default<commit_after>//
//  SalesforceError.swift
//  SwiftlySalesforce
//
//  For license & details see: https://www.github.com/mike4aday/SwiftlySalesforce
//  Copyright (c) 2016. All rights reserved.
//

public enum SalesforceError: Error {
	case userAuthenticationRequired
	case invalidity(message: String)
	case unsupportedURL(url: URL)
	case responseFailure(code: String, message: String, fields: [String]?)
	case jsonDeserializationFailure(elementName: String?, json: Any)
	case serverFailure
}

extension SalesforceError: CustomDebugStringConvertible {
	
	public var debugDescription: String {
		switch self {
		case .userAuthenticationRequired:
			return "User authentication required"
		case let .invalidity(message):
			return "Invalid: \(message)"
		case let .unsupportedURL(url):
			return "Unsupported URL: \(url.absoluteString)"
		case let .responseFailure(code, message, fields):
			return "Salesforce response failure. Code: \(code). Message: \(message). Fields: \(fields ?? [])"
		case let .jsonDeserializationFailure(elementName, json):
			return "JSON serialization failure. Elmement name: \(elementName ?? "None"). JSON: \(json)"
		case .serverFailure:
			return "Server failure"
		}
	}
}
{'fraction_non_alphanumeric': 0.11384217335058215, 'fraction_numerical': 0.004312203536006899, 'mean_word_length': 4.714285714285714, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '7536385', 'n_tokens_mistral': 715, 'n_tokens_neox': 648, 'n_words': 198}