dash.assert.type

Throw error if input is not an allowed data type


Syntax



Description

dash.assert.type(input, types)

Checks if input is the required data type. If not, throws an error.

dash.assert.type(input, types, name, descriptor)

Uses a custom name and data type descriptor in thrown error messages.

dash.assert.type(input, types, name, descriptor, idHeader)

Uses a custom header in thrown error IDs.


Input Arguments

input

any data type
The input being tested

types

string vector
The allowed data types

name

string scalar
The name of the input in the calling function for use in error messages. Default is “input”

descriptor

string scalar
Descriptor for data type in error messages. Default is “data type”

idHeader

string scalar
Header for thrown error IDs. Default is “DASH:assert:type”