mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-19 03:33:36 +01:00
refactor: Reduce duplicate code with Error.message()
also add some things I forgot in previous commits
This commit is contained in:
13
AltStore/Extensions/Error+Message.swift
Normal file
13
AltStore/Extensions/Error+Message.swift
Normal 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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user