b6fdee8bfc
Consolidated release: the cross-platform Linux port (engine, generators, CLI, REPL, NRT, portable DSP), live ALSA audio + ALSA MIDI + POSIX OSC + portable WAV codec, the GTK4 GUI (LyrebirdUI on the SwiftOpenUI backend), and the Linux live-coding scratchpad (LiveCompile). Apple platforms unchanged; all additive. See RELEASES.md and LINUX_README.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
40 lines
1.4 KiB
Swift
40 lines
1.4 KiB
Swift
// SourceKitLSPError.swift
|
|
// Lyrebird
|
|
//
|
|
// Copyright (c) 2026 Joshua Parmenter / realizedsound
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
// LyrebirdLiveCompile
|
|
//
|
|
// Errors surfaced by ``SourceKitLSPClient``. macOS/Linux only.
|
|
|
|
#if os(macOS) || os(Linux)
|
|
|
|
/// A failure from the `sourcekit-lsp` client.
|
|
public enum SourceKitLSPError: Error, CustomStringConvertible {
|
|
/// The `sourcekit-lsp` executable could not be launched (bad path, missing
|
|
/// toolchain, spawn failure). Thrown from ``SourceKitLSPClient/start(rootURI:)``.
|
|
case launchFailed(String)
|
|
/// A request was made against a client that was never started or has been
|
|
/// shut down (or the server exited). Also used to fail in-flight requests
|
|
/// when the server dies.
|
|
case notRunning
|
|
/// A request exceeded the client's per-request timeout. Guards against a
|
|
/// wedged server; carries the LSP method that timed out.
|
|
case timedOut(method: String)
|
|
/// The server returned a JSON-RPC error response, carrying its code and
|
|
/// message.
|
|
case serverError(code: Int, message: String)
|
|
|
|
public var description: String {
|
|
switch self {
|
|
case .launchFailed(let m): return "sourcekit-lsp failed to launch: \(m)"
|
|
case .notRunning: return "sourcekit-lsp is not running"
|
|
case .timedOut(let m): return "sourcekit-lsp timed out on \(m)"
|
|
case .serverError(let c, let m): return "sourcekit-lsp error \(c): \(m)"
|
|
}
|
|
}
|
|
}
|
|
|
|
#endif
|