Exceptions in #Script Pages are normally caught on the page and displayed using the Error Handling methods, e.g. I’ll typically have a htmlError at the bottom of my layout page to display errors in a bootstrap styled alert which includes additional detail when in DebugMode:
{{htmlError}}
The Exceptions that are rethrown are FatalExceptions, i.e. NotSupportedException, NotImplementedException, StackOverflowException these are typically bugs in your code that shouldn’t exist and should be fixed immediately, like Syntax errors which would normally be a compile error in compiled code.
Note: the are also validation error helpers as seen in the World Validation Script Server example that will display the Response Error message in an alert:
<h3>Error Summary</h3>
{{validationSummary}}
It also lets you exclude a summary message for field validation error messages you’re handling the display of, e.g:
<h3>Error Summary</h3>
<div class="form-group">
Show error message unless there's a field validation error for `name`:
{{ 'name' |> validationSummary }}
</div>
<div class="form-group">
Render `name` input text box along with any `name` field validation errors:
{{ {id:'name',placeholder:'Name'}
|> formInput({label:'Full Name',help:'Your first and last name'}) }}
</div>