Skip to main content

parameter ()

Returns an error message stating an issue with one or more parameters.

Parameters

$message
The message which describes the issue.
Type
String
$context
The name of the function or mixin issuing the error.
Type
String
$names
The names of the parameters for which there is an issue.
Type
ArgList

Return Value

String
A string describing the reason one or more parameters are invalid.

Example

@sass-fairy/map/src/_from.sass
// Copyright (c) roydukkey. All rights reserved.
// Licensed under the MIT. See LICENSE file in the project root for full license information.

@use 'sass:list'
@use 'sass:map'
@use '@sass-fairy/exception'


@function from($pairs...)

@if list.length($pairs) < 1
@error exception.parameter('One or more key/value pairs are required', 'from', 'pairs')

$result: ()

@each $key, $value in $pairs
$result: map.set($result, $key, $value)

@return $result