-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexceptions.html
More file actions
35 lines (27 loc) · 1.78 KB
/
Copy pathexceptions.html
File metadata and controls
35 lines (27 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
layout: default
---
<div class="content">
<h1>Exceptions</h1>
<p>Tyranid provides the following exceptions:</p>
<table>
<thead>
<tr>
<th>Exception<th>Usage<th>HTTP Code<a href="#httpCode"><super>*</super></a><th>Example Reporting
<tbody>
<tr>
<td><a href="appError">AppError</a><td>Use for any sort of application-level exception that is unexpected.<td>500<td>Bugsnag
<tr>
<td><a href="eventCancelError">EventCancelError</a><td>Generally should not be used manually, sent when an event handler calls "preventDefault()".<td>Not rethrown
<td>Not reported since this indicates that an event should not be propagated for non-error reasons.
<tr>
<td><a href="secureError">SecureError</a><td>Use for any sort of security violations like access denied.<td>403<td>Security log
<tr>
<td><a href="userError">UserError</a><td>Use for any sort of user errors where the problem lies with bad input or data from the user.<td>400
<td>Not logged, reported inline in the user interface (for example, below form fields, or as toast messages, depending on the context)
</table>
<div id="httpCode"><super>*</super> The HTTP codes can be overridden in the <a href="tyr#config"><u>Tyr.config()</u></a> call.</div>
<p>Exceptions that have an HTTP Code defined indicate that the exception will be rethrown in the <i>calling context</i>. For example, if a
call is made in the web browser to a server via a <a href="services">service</a>, and the service throws a rethrowable exception, then the exception thrown on
the server will be caught, serialized, sent along the HTTP, and then reified and rethrown on the client.</p>
<p>Exceptions thrown inside event handlers will also be rethrown in the calling context.</p>