'Synapse notebook input validation deprecation warning

I am trying to do some input validation in a Synapse notebook running in Scala mode like this:

if (! someInputParameter.startsWith("/")) {
    error("Parameter someInputParameter should start with a forward slash (/).")
}

But I receive the following error:

warning: there was one deprecation warning; re-run with -deprecation for details

I'm guessing there is a newer way of doing this which does not trigger the deprecation warning? I don't know how to run the notebook in a mode with the -deprecation switch. I imagine it would be similar in Azure Databricks but haven't test yet.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source