function tst_err_reporting (do_anon = true)
  disp ("Entered function 'tst_err_reporting'");

  subfunction1 (do_anon);

endfunction

function subfunction1 (do_anon)
  disp ("Entered function 'tst_err_reporting>subfunction1'");
 
  fanon = @(x) x + 1;

  if (do_anon)
    fanon (1, 2);   # Will cause a parse error
  else
    error ("calling error() function from 'subfunction1'");
  endif

endfunction

