-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathappError.html
More file actions
114 lines (95 loc) · 4.64 KB
/
Copy pathappError.html
File metadata and controls
114 lines (95 loc) · 4.64 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
---
layout: default
---
<div class="content">
<h1>AppError <span class="extends">extends <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a></span></h1>
<p>This is an extension of the standard JavaScript <u>Error</u> object.</p>
<p>It should be used for system and application errors that were caused by internal failures of the application.</p>
<p>This is contrast to <a href="userError"><u>UserError</u></a> which indicates an error caused by bad user input or user data.</p>
<p>Typically <u>AppError</u>s will be logged to a log file or a bug-tracking service like <a href="https://bugsnag.com">Bugsnag</a> while <u>UserError</u>s
will not be logged and will instead be presented to the end-user either as a pop-up or inline in forms.</p>
<p>See <a href="exceptions">Exceptions</a> for more information.</p>
<h2>constructor</h2>
<article id="constructor">
<b class="constructor"></b>
<b class="server"></b>
<b class="client"></b>
<span class="sig">(opts: object | string)</span>
<p>If <u>opts</u> is a string, then it contains the <i>technical</i> description of the problem. The <i>message</i> will default to "Internal Application
Error" (or whatever is defined in <a href="tyr#options"><u>Tyr.config()</u></a> under the <u>exceptions</u> entry.</p>
<p>If <u>opts</u> is an objec†, then:
<pre><code class="js">{
message: string; <i>// This message contains an end-user-facing error message that can be displayed in the UI.</i>
technical?: string; <i>// If present, this should contain additional technical information that would be relevant to a software developer.</i>
field?: <a href="field">Field</a>; <i>// This indicates an error is directly related to a given field.</i>
lineNumber?: number; <i>// This indicates any line number that has to do with the error message.</i>
rowNumber?: number; <i>// This indicates any row number that has to do with the error message.</i>
columnNumber?: number; <i>// This indicates any column number that has to do with the error message.</i>
}
</code></pre>
</article>
<h2>instance</h2>
<article id="columnNumber">
<b class="property"></b>
<b class="server"></b>
<b class="client"></b>
<span class="sig">columnNumber?: number</span>
<p>This indicates any column number that has to do with the error message.</p>
</article>
<article id="field">
<b class="property"></b>
<b class="server"></b>
<b class="client"></b>
<span class="sig">field?: <a href="field">Field</a></span>
<p>This indicates an error is directly related to a given field.</p>
</article>
<article id="lineNumber">
<b class="property"></b>
<b class="server"></b>
<b class="client"></b>
<span class="sig">lineNumber?: number</span>
<p>This indicates any line number that has to do with the error message.</p>
</article>
<article id="message">
<b class="property"></b>
<b class="server"></b>
<b class="client"></b>
<span class="sig">message: string</span>
<p>This message contains an end-user-facing error message that can be displayed in the UI.</p>
</article>
<article id="rowNumber">
<b class="property"></b>
<b class="server"></b>
<b class="client"></b>
<span class="sig">rowNumber?: number</span>
<p>This indicates any row number that has to do with the error message.</p>
</article>
<article id="stack">
<b class="property"></b>
<b class="server"></b>
<b class="client"></b>
<span class="sig">stack?: string</span>
<p>This contains the stack trace if available.</p>
</article>
<article id="technical">
<b class="property"></b>
<b class="server"></b>
<b class="client"></b>
<span class="sig">technical?: string</span>
<p>If present, this should contain additional technical information that would be relevant to a software developer.</p>
</article>
<article id="toPlain">
<b class="method"></b>
<b class="server"></b>
<b class="client"></b>
<span class="sig">toPlain(): object</span>
<p>This returns a "Plain old JavaScript object" representation of this exception that is suitable for stringifying to JSON.</p>
</article>
<article id="toString">
<b class="method"></b>
<b class="server"></b>
<b class="client"></b>
<span class="sig">toString(): string</span>
<p>This returns <u>message</u>.</p>
</article>
</div>