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