Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conform Swiftly's Error type to CustomStringConvertible #203

Merged
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions Sources/SwiftlyCore/Error.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import Foundation

public struct Error: LocalizedError {
public struct Error: LocalizedError, CustomStringConvertible {
public let message: String

public init(message: String) {
self.message = message
}

public var errorDescription: String? { self.message }
public var errorDescription: String { self.message }
public var description: String { self.message }
}
5 changes: 3 additions & 2 deletions Tools/build-swiftly-release/BuildSwiftlyRelease.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ public struct SwiftRelease: Codable {
}

// These functions are cloned and adapted from SwiftlyCore until we can do better bootstrapping
public struct Error: LocalizedError {
public struct Error: LocalizedError, CustomStringConvertible {
public let message: String

public init(message: String) {
self.message = message
}

public var errorDescription: String? { self.message }
public var errorDescription: String { self.message }
public var description: String { self.message }
}

public func runProgramEnv(_ args: String..., quiet: Bool = false, env: [String: String]?) throws {
Expand Down
Loading