Files
playdate-kit/Sources/PlaydateKit/Playdate/Structures/PlaydateError.swift
T

15 lines
441 B
Swift
Raw Normal View History

/// An error reported by the Playdate OS.
public struct PlaydateError: Swift.Error, Sendable {
2026-09-18 13:15:08 +00:00
/// The OS message, or a description of the failure.
public let message: String
init(message: String) {
self.message = message
}
2026-09-18 13:15:08 +00:00
/// Copies an OS C string; null yields "unknown error".
init(cString: UnsafePointer<CChar>?) {
self.init(message: String(playdateCString: cString) ?? "unknown error")
}
}