Errors
Here are the breakdown of all the parsing errors that can happen when passing erronous arguments to the exposed functions. The parsing error ranges from passing too many arguments to the function all the way upto referencing an unknown property in the provided schema_map.
#
Arguments Length mismatchThis error occurs when the number of arguments passed to the function doesnt match any of its signature. As an example lets take a look at the slice add function. It has two signatures:-
(text, text)
(number, number)
That means the function will not throw the argument length mismatch error as long as both the first and second arguments are either text or numbers.
But if one or three arguments are passed, then the error will be thrown.
result_type
mismatch#
Arguments Continuing with the above example, the function add will take on two arguments both of which has to be the type of either text
or number
.
Thus if a different type of argument is passed then the function would throw an error.
#
Using usupported functionAn error will also be throw when an unknown function is used. Take a look here to see the list of all the available functions.
#
Unknown Property referenceNotion formula gives the superpower of using arguments that could be another property of the schema. In that case the formula uses the value of that particular cell to formulate the final value. But if the property doesnot exist in the provided schema_map then it makes sense to throw an error, as thats also the native nature of the actual client.
We can take a look at an example of when this error will be raised using the same function add
,
- JS
- TS
Property arguments mismatched result_type
Property referenced arguments will be checked for argument type mismatch error.
Required schema_map
argument
Even though the schema_map
argument is optional, you must always provide the schema_map if you are trying to use property reference as an argument. Otherwise an error will be thrown
Typescript Power
Its highly encouraged to use typescript, since it can statically check for any of the above errors.