Errors

Types thrown as errors – see CompilerError too.


Topics

struct ProtocolError

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.

Declaration
Swift
public struct ProtocolError: Error, CustomStringConvertible

struct LifecycleError

Thrown on detecting a usage error of the Compiler API, for example trying to use it after shutdown.

Declaration
Swift
public struct LifecycleError: Error, CustomStringConvertible

enum SassFunctionError

Errors thrown for common SassFunction scenarios.

Generally these are thrown from your SassFunctions by SassValue family methods in response to error scenarios, for example a user passes a number where you expect a string, or a number in radians where you expected a length. Then the compilation fails, giving the description of the error as the failure reason.

Declaration
Swift
public enum SassFunctionError: Error, CustomStringConvertible