Files
openclaw/apps/shared/OpenClawKit/Sources/OpenClawKit/NodeError.swift

29 lines
805 B
Swift
Raw Normal View History

2025-12-12 21:18:46 +00:00
import Foundation
2026-01-30 03:15:10 +01:00
public enum OpenClawNodeErrorCode: String, Codable, Sendable {
2025-12-12 21:18:46 +00:00
case notPaired = "NOT_PAIRED"
case unauthorized = "UNAUTHORIZED"
case backgroundUnavailable = "NODE_BACKGROUND_UNAVAILABLE"
case invalidRequest = "INVALID_REQUEST"
case unavailable = "UNAVAILABLE"
}
2026-01-30 03:15:10 +01:00
public struct OpenClawNodeError: Error, Codable, Sendable, Equatable {
public var code: OpenClawNodeErrorCode
2025-12-12 21:18:46 +00:00
public var message: String
public var retryable: Bool?
public var retryAfterMs: Int?
public init(
2026-01-30 03:15:10 +01:00
code: OpenClawNodeErrorCode,
2025-12-12 21:18:46 +00:00
message: String,
retryable: Bool? = nil,
retryAfterMs: Int? = nil)
{
self.code = code
self.message = message
self.retryable = retryable
self.retryAfterMs = retryAfterMs
}
}