Skip to content
This repository has been archived by the owner on Jan 4, 2021. It is now read-only.

Commit

Permalink
[DEV] Error management
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainCscn committed Apr 19, 2018
1 parent 6c17a31 commit 1d12c5b
Show file tree
Hide file tree
Showing 71 changed files with 48,767 additions and 54,413 deletions.
4 changes: 2 additions & 2 deletions dist/myscript.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/myscript.min.js.map

Large diffs are not rendered by default.

51,434 changes: 24,639 additions & 26,795 deletions docs/ast/source/Editor.js.json

Large diffs are not rendered by default.

511 changes: 363 additions & 148 deletions docs/ast/source/configuration/Constants.js.json

Large diffs are not rendered by default.

48,875 changes: 22,810 additions & 26,065 deletions docs/ast/source/recognizer/websocket/v4/Cdkv4WSIInkRecognizer.js.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/badge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
191 changes: 60 additions & 131 deletions docs/class/src/Editor.js~Editor.html

Large diffs are not rendered by default.

38 changes: 18 additions & 20 deletions docs/coverage.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"coverage": "90.8%",
"expectCount": 250,
"coverage": "91.53%",
"expectCount": 248,
"actualCount": 227,
"files": {
"src/model/RecognizerContext.js": {
Expand All @@ -9,20 +9,19 @@
"undocumentLines": []
},
"src/Editor.js": {
"expectCount": 60,
"expectCount": 59,
"actualCount": 53,
"undocumentLines": [
425,
420,
504,
931,
454,
605,
606
416,
411,
495,
445,
596,
597
]
},
"src/recognizer/websocket/v4/Cdkv4WSIInkRecognizer.js": {
"expectCount": 28,
"expectCount": 27,
"actualCount": 19,
"undocumentLines": [
98,
Expand All @@ -32,8 +31,7 @@
68,
204,
211,
218,
459
218
]
},
"src/renderer/canvas/symbols/MathSymbolCanvasRenderer.js": {
Expand Down Expand Up @@ -198,6 +196,11 @@
"actualCount": 1,
"undocumentLines": []
},
"src/renderer/canvas/symbols/StrokeSymbolCanvasRenderer.js": {
"expectCount": 1,
"actualCount": 1,
"undocumentLines": []
},
"src/renderer/svg/symbols/StrokeSymbolSVGRenderer.js": {
"expectCount": 1,
"actualCount": 1,
Expand All @@ -213,11 +216,6 @@
"actualCount": 2,
"undocumentLines": []
},
"src/renderer/canvas/symbols/StrokeSymbolCanvasRenderer.js": {
"expectCount": 1,
"actualCount": 1,
"undocumentLines": []
},
"src/callback/EventCallback.js": {
"expectCount": 1,
"actualCount": 1,
Expand All @@ -233,7 +231,7 @@
"actualCount": 3,
"undocumentLines": []
},
"src/recognizer/common/CdkCommonUtil.js": {
"src/recognizer/common/v3/Cdkv3CommonTextRecognizer.js": {
"expectCount": 1,
"actualCount": 1,
"undocumentLines": []
Expand All @@ -243,7 +241,7 @@
"actualCount": 4,
"undocumentLines": []
},
"src/recognizer/common/v3/Cdkv3CommonTextRecognizer.js": {
"src/recognizer/common/CdkCommonUtil.js": {
"expectCount": 1,
"actualCount": 1,
"undocumentLines": []
Expand Down
1,355 changes: 624 additions & 731 deletions docs/dump.json

Large diffs are not rendered by default.

22 changes: 4 additions & 18 deletions docs/file/src/Editor.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-pointerEvents">pointerEvents</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-redo">redo</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-resize">resize</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-restoreSession">restoreSession</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setPenStyle">setPenStyle</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setPenStyleClasses">setPenStyleClasses</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setTheme">setTheme</a></span></span></li>
Expand Down Expand Up @@ -436,10 +435,12 @@
(err.error.result.error === &apos;InvalidApplicationKeyException&apos; || err.error.result.error === &apos;InvalidHMACSignatureException&apos;)
)) {
editorRef.error.innerText = Constants.Error.WRONG_CREDENTIALS;
} else if (editorRef.error.style.display === &apos;none&apos;) {
} else if (err.message === &apos;Session is too old. Max Session Duration Reached&apos;) {
editorRef.error.innerText = Constants.Error.TOO_OLD;
} else if (err.message &amp;&amp; editorRef.error.style.display === &apos;none&apos;) {
editorRef.error.innerText = Constants.Error.NOT_REACHABLE;
}
if ((err.message === &apos;Session is too old. Max Session Duration Reached&apos; || err.code === 1006) &amp;&amp; RecognizerContext.canReconnect(editor.recognizerContext)) {
if ((editorRef.error.innerText === Constants.Error.TOO_OLD || err.code === 1006) &amp;&amp; RecognizerContext.canReconnect(editor.recognizerContext)) {
logger.info(&apos;Reconnection is available&apos;, err.stack || err);
editorRef.error.style.display = &apos;none&apos;;
} else {
Expand Down Expand Up @@ -489,17 +490,6 @@
editorRef.smartGuide = SmartGuide.launchSmartGuide(editor.smartGuide, exports);
}

function launchRestoreSession(editor, model) {
if (editor.recognizer &amp;&amp; editor.recognizer.restoreSession) {
editor.recognizerContext.initPromise
.then(() =&gt; {
editor.recognizer.restoreSession(editor.recognizerContext, model, editor.domElement, (err, res, ...types) =&gt; {
recognizerCallback(editor, err, res, ...types);
});
});
}
}

/**
* Launch ink import.
* @param {Editor} editor
Expand Down Expand Up @@ -1193,10 +1183,6 @@
launchImport(this, this.model, !(data instanceof Blob) ? new Blob([data], { type: mimetype }) : data);
}

restoreSession() {
launchRestoreSession(this, this.model);
}

/**
* pointer events
* @param {PointerEvents} events
Expand Down
1 change: 0 additions & 1 deletion docs/file/src/EditorFacade.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-pointerEvents">pointerEvents</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-redo">redo</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-resize">resize</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-restoreSession">restoreSession</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setPenStyle">setPenStyle</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setPenStyleClasses">setPenStyleClasses</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setTheme">setTheme</a></span></span></li>
Expand Down
1 change: 0 additions & 1 deletion docs/file/src/callback/EventCallback.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-pointerEvents">pointerEvents</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-redo">redo</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-resize">resize</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-restoreSession">restoreSession</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setPenStyle">setPenStyle</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setPenStyleClasses">setPenStyleClasses</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setTheme">setTheme</a></span></span></li>
Expand Down
4 changes: 2 additions & 2 deletions docs/file/src/configuration/Constants.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-pointerEvents">pointerEvents</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-redo">redo</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-resize">resize</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-restoreSession">restoreSession</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setPenStyle">setPenStyle</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setPenStyleClasses">setPenStyleClasses</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setTheme">setTheme</a></span></span></li>
Expand Down Expand Up @@ -339,7 +338,8 @@
},
Error: {
NOT_REACHABLE: &apos;MyScript recognition server is not reachable. Please reload once you are connected.&apos;,
WRONG_CREDENTIALS: &apos;Application credentials are invalid. Please check or regenerate your application key and hmackey.&apos;
WRONG_CREDENTIALS: &apos;Application credentials are invalid. Please check or regenerate your application key and hmackey.&apos;,
TOO_OLD: &apos;Session is too old. Max Session Duration Reached.&apos;
},
Exports: {
JIIX: &apos;application/vnd.myscript.jiix&apos;
Expand Down
1 change: 0 additions & 1 deletion docs/file/src/configuration/DefaultBehaviors.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-pointerEvents">pointerEvents</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-redo">redo</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-resize">resize</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-restoreSession">restoreSession</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setPenStyle">setPenStyle</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setPenStyleClasses">setPenStyleClasses</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setTheme">setTheme</a></span></span></li>
Expand Down
1 change: 0 additions & 1 deletion docs/file/src/configuration/DefaultConfiguration.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-pointerEvents">pointerEvents</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-redo">redo</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-resize">resize</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-restoreSession">restoreSession</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setPenStyle">setPenStyle</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setPenStyleClasses">setPenStyleClasses</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setTheme">setTheme</a></span></span></li>
Expand Down
1 change: 0 additions & 1 deletion docs/file/src/configuration/DefaultPenStyle.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-pointerEvents">pointerEvents</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-redo">redo</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-resize">resize</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-restoreSession">restoreSession</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setPenStyle">setPenStyle</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setPenStyleClasses">setPenStyleClasses</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setTheme">setTheme</a></span></span></li>
Expand Down
1 change: 0 additions & 1 deletion docs/file/src/configuration/DefaultTheme.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-pointerEvents">pointerEvents</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-redo">redo</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-resize">resize</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-restoreSession">restoreSession</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setPenStyle">setPenStyle</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setPenStyleClasses">setPenStyleClasses</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setTheme">setTheme</a></span></span></li>
Expand Down
1 change: 0 additions & 1 deletion docs/file/src/configuration/LoggerConfig.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-pointerEvents">pointerEvents</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-redo">redo</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-resize">resize</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-restoreSession">restoreSession</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setPenStyle">setPenStyle</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setPenStyleClasses">setPenStyleClasses</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setTheme">setTheme</a></span></span></li>
Expand Down
1 change: 0 additions & 1 deletion docs/file/src/grabber/PointerEventGrabber.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-pointerEvents">pointerEvents</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-redo">redo</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-resize">resize</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-restoreSession">restoreSession</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setPenStyle">setPenStyle</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setPenStyleClasses">setPenStyleClasses</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setTheme">setTheme</a></span></span></li>
Expand Down
1 change: 0 additions & 1 deletion docs/file/src/model/InkModel.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-pointerEvents">pointerEvents</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-redo">redo</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-resize">resize</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-restoreSession">restoreSession</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setPenStyle">setPenStyle</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setPenStyleClasses">setPenStyleClasses</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-setTheme">setTheme</a></span></span></li>
Expand Down
Loading

0 comments on commit 1d12c5b

Please sign in to comment.