mirror of
https://github.com/nalinbhardwaj/Vespass.git
synced 2026-01-14 00:07:56 -05:00
31 lines
697 B
Swift
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)
|
|
}
|
|
}
|