SassFunctionError

Swift
public enum SassFunctionError: Error, CustomStringConvertible

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.


Topics

case wrongType(expected: String, actual: SassValue)

A Sass value was not the expected type.

Declaration
Swift
case wrongType(expected: String, actual: SassValue)

case badListIndex(max: Int, actual: Int)

A Sass value used as a list index was out of range.

Declaration
Swift
case badListIndex(max: Int, actual: Int)

case badStringIndex(max: Int, actual: Int)

A Sass value used as a string index was out of range.

Declaration
Swift
case badStringIndex(max: Int, actual: Int)

case notInteger(SassNumber)

A SassNumber used as an integer wasn’t.

Declaration
Swift
case notInteger(SassNumber)

case notInRange(SassNumber, String)

A SassNumber was not in the expected range.

Declaration
Swift
case notInRange(SassNumber, String)

case unconvertibleUnit1(from: String, to: String, specifically: String)

A SassNumber couldn’t be converted to some requested units.

Declaration
Swift
case unconvertibleUnit1(from: String, to: String, specifically: String)

case unconvertibleUnit2(from: String, to: String, leftovers: String)

A SassNumber couldn’t be converted to requested units.

Declaration
Swift
case unconvertibleUnit2(from: String, to: String, leftovers: String)

case uncancelledUnits(numerator: String, denominator: String)

A SassNumber couldn’t be formed because of uncancelled units.

Declaration
Swift
case uncancelledUnits(numerator: String, denominator: String)

case unexpectedUnits(SassNumber)

A SassNumber had units that weren’t expected.

Declaration
Swift
case unexpectedUnits(SassNumber)

case missingUnit(SassNumber, String)

A SassNumber didn’t have a specific single unit.

Declaration
Swift
case missingUnit(SassNumber, String)

case channelNotInRange(String, Double, String)

A color channel value was not in the expected range.

Declaration
Swift
case channelNotInRange(String, Double, String)

case badColorSpace(String)

A color space name was not recognized.

Declaration
Swift
case badColorSpace(String)

var description: String

A human-readable description of the error.

Declaration
Swift
public var description: String { get }