Meshtastic-Apple/Meshtastic/AppIntents/AppIntentErrors.swift

28 lines
620 B
Swift
Raw Permalink Normal View History

//
// AppIntentErrors.swift
// Meshtastic
//
// Created by Benjamin Faershtein on 8/11/24.
//
import Foundation
import OSLog
class AppIntentErrors {
enum AppIntentError: Swift.Error, CustomLocalizedStringResourceConvertible {
case notConnected
case message(_ message: String)
var localizedStringResource: LocalizedStringResource {
switch self {
2024-10-05 15:50:57 -07:00
case let .message(message):
2025-04-27 14:04:47 -07:00
Logger.services.error("App Intent: \(message, privacy: .public)")
return "Error: \(message)"
case .notConnected:
Logger.services.error("App Intent: No Connected Node")
return "No Connected Node"
}
}
}
}