-
Notifications
You must be signed in to change notification settings - Fork 187
Expand file tree
/
Copy pathTestErrorPage.swift
More file actions
41 lines (33 loc) · 897 Bytes
/
TestErrorPage.swift
File metadata and controls
41 lines (33 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// TestErrorPage.swift
// Ignite
// https://www.github.com/twostraws/Ignite
// See LICENSE for license information.
//
import Foundation
import Ignite
struct TestErrorPage: ErrorPage {
var title: String = "Test Error Page"
var description: String = "Test Error Page Description"
let errorChecker: (HTTPError) -> Void
init(
title: String = "Test Error Page",
description: String = "Test Error Page Description",
errorChecker: @escaping (HTTPError) -> Void = { _ in }
) {
self.title = title
self.description = description
self.errorChecker = errorChecker
}
var body: some HTML {
ErrorChecker { errorChecker(error) }
}
struct ErrorChecker: HTML {
init(handler: @escaping () -> Void) {
handler()
}
var body: some HTML {
EmptyHTML()
}
}
}