Skip to content

Instantly share code, notes, and snippets.

public typealias HandleAction<T> = (T) throws -> ()
public protocol ErrorHandleable: class {
func `throw`(_: Error, finally: @escaping (Bool) -> Void)
func `catch`(action: @escaping HandleAction<Error>) -> ErrorHandleable
}
public class ErrorHandler: ErrorHandleable {
private var parent: ErrorHandler?
private let action: HandleAction<Error>