Files
Vespass/Backend/Storage/KeyStoreError.swift
Nalin Bhardwaj 83781c6fa1 secrets refactor
working demo
2023-01-18 03:06:16 -08:00

31 lines
697 B
Swift

//
// KeyStoreError.swift
// Vespass
//
// Created by Nalin Bhardwaj on 22/12/22.
// Copyright © 2022 Vespass. All rights reserved.
//
// Errors that can be generated as a result of attempting to store keys.
import Foundation
/// An error we can throw when something goes wrong.
struct KeyStoreError: Error, CustomStringConvertible {
var message: String
init(_ message: String) {
self.message = message
}
public var description: String {
return message
}
}
extension OSStatus {
/// A human readable message for the status.
var message: String {
return (SecCopyErrorMessageString(self, nil) as String?) ?? String(self)
}
}