Avoiding bad data through parameter validation makes a programmer’s job that much easier.

In the past, errors that have been passed back to the user were not always very useful.

Learn how to enhance your advanced functions to take advantage of this new functionality!

All cameras and smart hub from Reolink that made it to works with home assist certified.

What is theErrorMessageproperty?

Three parameter validation decorators have the extraErrorMessageproperty available to them.

What does this property actually do?

Rockbox on an iPod Nano

First, let’s look at the old way of doing this.

In the example code below, we are usingValidatePatternto test if a string is 8 digits.

Where doesErrorMessagecome in then?

Article image

Extending theErrorMessageFunctionality

Utilizing theErrorMessageparameter makes for a much more user-friendly error display.

One aspect that is missing is the value that is passed in itself.

This syntax works on all three validation decorators and in the same way.

Article image

With the upgrade comes numerous speed, security, and functionality benefits as well.

Enhance your advanced functions with this useful property and make life easier for the users of your functions today!

Article image

Article image

Article image