-
Notifications
You must be signed in to change notification settings - Fork 1
/
Errors.swift
34 lines (29 loc) · 1.03 KB
/
Errors.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//
// Errors.swift
// DartSass
//
// Licensed under MIT (https://github.com/johnfairh/swift-sass/blob/main/LICENSE)
//
// Errors thrown by this module
/// Thrown on detecting an error communicating with the Sass embedded compiler: for example a badly
/// formed or out-of-sequence message.
///
/// The payload is text describing the nature of the problem. There is probably nothing that
/// a user can do about this.
public struct ProtocolError: Error, CustomStringConvertible {
/// Text explaining the protocol error.
public let description: String
init(_ text: String) {
description = text
Compiler.logger.debug("protocol_error: \(text)")
}
}
/// Thrown on detecting a usage error of the `Compiler` API, for example trying to use it after shutdown.
public struct LifecycleError: Error, CustomStringConvertible {
/// Text explaining the lifecycle error.
public let description: String
init(_ text: String) {
description = text
Compiler.logger.debug("lifecycle_error: \(text)")
}
}