Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Libraries/Connect/Interfaces/ConnectError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ public struct ConnectError: Swift.Error {
}
}

public init(
code: Code, message: String?, exception: Error?, details: [Detail], metadata: Headers
) {
self.code = code
self.message = message
self.exception = exception
self.details = details
self.metadata = metadata
}

/// Error details are sent over the network to clients, which can then work with
/// strongly-typed data rather than trying to parse a complex error message. For
/// example, you might use details to send a localized error message or retry
Expand All @@ -62,6 +72,11 @@ public struct ConnectError: Swift.Error {
case type = "type"
case payload = "value"
}

public init(type: String, payload: Data?) {
self.type = type
self.payload = payload
}
}
}

Expand Down