Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
33 lines
952 B
Swift
33 lines
952 B
Swift
//
|
|
// AnalyticsError.swift
|
|
//
|
|
//
|
|
// Created by Loris Perret on 11/12/2023.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
enum AnalyticsError: Error {
|
|
case fileNotExists(String)
|
|
case missingElement(String)
|
|
case invalidParameter(String)
|
|
|
|
case writeFile(String, String)
|
|
|
|
var description: String {
|
|
switch self {
|
|
case .fileNotExists(let filename):
|
|
return "error: [\(Analytics.toolName)] File \(filename) does not exists "
|
|
|
|
case .missingElement(let element):
|
|
return "error: [\(Analytics.toolName)] Missing \(element) for Matomo"
|
|
|
|
case .invalidParameter(let reason):
|
|
return "error: [\(Analytics.toolName)] Invalid parameter \(reason)"
|
|
|
|
case .writeFile(let subErrorDescription, let filename):
|
|
return "error: [\(Analytics.toolName)] An error occured while writing content to \(filename): \(subErrorDescription)"
|
|
}
|
|
}
|
|
}
|