refactor: Reduce duplicate code with Error.message()

also add some things I forgot in previous commits
This commit is contained in:
naturecodevoid
2023-06-01 07:36:40 -07:00
parent 175b5bec95
commit 7bb1c1cf05
6 changed files with 21 additions and 14 deletions

View File

@@ -0,0 +1,13 @@
//
// Error+Message.swift
// SideStore
//
// Created by naturecodevoid on 5/30/23.
// Copyright © 2023 SideStore. All rights reserved.
//
extension Error {
func message() -> String {
(self as? LocalizedError)?.failureReason ?? self.localizedDescription
}
}