SassFunctionError
Swift
public enum SassFunctionError: Error, CustomStringConvertible
Errors thrown for common SassFunction
scenarios.
Generally these are thrown from your SassFunction
s 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)
case wrongType(expected: String, actual: SassValue)
case badListIndex(max: Int, actual: Int)
case badListIndex(max: Int, actual: Int)
case badStringIndex(max: Int, actual: Int)
case badStringIndex(max: Int, actual: Int)
case notInteger(SassNumber)
case notInteger(SassNumber)
case notInRange(SassNumber, String)
case notInRange(SassNumber, String)
case unconvertibleUnit1(from: String, to: String, specifically: String)
case unconvertibleUnit1(from: String, to: String, specifically: String)
A SassNumber
couldn’t be converted to some requested units.
Declaration
case unconvertibleUnit2(from: String, to: String, leftovers: String)
case unconvertibleUnit2(from: String, to: String, leftovers: String)
A SassNumber
couldn’t be converted to requested units.
Declaration
case uncancelledUnits(numerator: String, denominator: String)
case uncancelledUnits(numerator: String, denominator: String)
A SassNumber
couldn’t be formed because of uncancelled units.
Declaration
case unexpectedUnits(SassNumber)
case unexpectedUnits(SassNumber)
case missingUnit(SassNumber, String)
case missingUnit(SassNumber, String)
A SassNumber
didn’t have a specific single unit.
Declaration
Swift
case missingUnit(SassNumber, String)
case channelNotInRange(String, Double, String)
case channelNotInRange(String, Double, String)
case badColorSpace(String)
case badColorSpace(String)
var description: String
var description: String