Do We Need Error Handling in WikiText?

Do you think there should be some basic error handling in WikiText? For example, consider:

\procedure validate-number(n)
<$let n={{{ [<n>regexp[^\d+$]then<n>else[1]] }}}>
<!-- your wikitext goes here -->
<<n>>
</$let>
\end

!! Examples
<<validate-number three>>

<<validate-number 3>>

IMO the example code is argument validation. While error handling is related to problem like preventing recursive transclusion of {{}} and handle wrong argument of decodebase64.

This really has pros and cons and ultimately is up to @jeremyruston and the development team to decide on the default behavior.

As first time user, I was certainly happy with TiddlyWiki not scaring me with long cryptic error messages and carpets of backtraces when something wrong happens behind the curtain - be that the core or third party plugin code, be that a problem in JavaScript or wikitext code.

As first time writer of wikitext (also spoiled by Python’s way of reporting errors), I was first disappointed, then frustrated, and sometimes even infuriated that either my code does not work (and it won’t tell me why!) or that I just have no idea how to do something (but that’s a slightly different issue) :rofl: Thus I had to resort to the forum, ask for help, then read the answers over and over until I got the feeling that I understand them (not necessarily the same as actually understanding them!).

As (still!) a beginner writer of very basic wikitext, I of course miss a lot of tools that make writing code easier:

  • better and more verbose error handling, like in your example. Maybe a widget that could wrap a wikitext code snippet and produce verbose error messages?
  • a linter for wikitext (forgetting closing tags etc) and especially for filter syntax (reasonable error messages about “pesky brackets” :tm: pitfalls)
  • out of the box GOOD and palette-aware syntax highlighting for wikitext in Tiddler edit mode