<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _raise_error_if_not_sarray(dataset, variable_name="SArray"):
 """ Check if the input is an SArray. Provide a proper error message otherwise. """

    err_msg = "Input %s is not an SArray."
    if not isinstance(dataset, _SArray):
      raise ToolkitError(err_msg % variable_name)