File tree Expand file tree Collapse file tree 1 file changed +39
-1
lines changed
Expand file tree Collapse file tree 1 file changed +39
-1
lines changed Original file line number Diff line number Diff line change 11/**
22 * @for p5
33 * @requires core
4+ *
5+ * This is the main file for the Friendly Error System (FES). Here is a
6+ * brief outline of the functions called in this system.
7+ *
8+ * The FES may be invoked by a call to either (1) _validateParameters,
9+ * (2) _friendlyFileLoadError, (3) _friendlyError, or (4) helpForMisusedAtTopLevelCode.
10+ *
11+ * helpForMisusedAtTopLevelCode is called by this file on window load to check for use
12+ * of p5.js functions outside of setup() or draw()
13+ * Items 1-3 above are called by functions in the p5 library located in other files.
14+ *
15+ * _friendlyFileLoadError is called by the loadX() methods.
16+ * _friendlyError can be called by any function to offer a helpful error message.
17+ *
18+ * _validateParameters is called by functions in the p5.js API to help users ensure
19+ * ther are calling p5 function with the right parameter types. The property
20+ * disableFriendlyErrors = false can be set from a p5.js sketch to turn off parameter
21+ * checking. The call sequence from _validateParameters looks something like this:
22+ *
23+ * _validateParameters
24+ * lookupParamDoc
25+ * scoreOverload
26+ * testParamTypes
27+ * testParamType
28+ * getOverloadErrors
29+ * _friendlyParamError
30+ * ValidationError
31+ * report
32+ * friendlyWelcome
33+ *
34+ * The call sequences to _friendlyFileLoadError and _friendlyError are like this:
35+ * _friendlyFileLoadError
36+ * report
37+ *
38+ * _friendlyError
39+ * report
40+ *
41+ * report() is the main function that prints directly to console with the output
42+ * of the error helper message. Note: friendlyWelcome() also prints to console directly.
443 */
5-
644import p5 from './main' ;
745import * as constants from './constants' ;
846
You can’t perform that action at this time.
0 commit comments