Improvemnts in error handling

This commit is contained in:
Luis Fernando Molina committed 2021-01-21 20:50:43 +01:00
1 parent 3ea470bf60
commit 3a11c1e2b3
6 files changed
+114 -5

No files matched your search

+1 -1
View File
@@ -155,7 +155,7 @@
</div>
<div class="menu-row">
<div class="menu-item" onClick="window.contextMenu.toPlaceholder()">
<img src="Icons/Superalgos/bitcoin.png" class="menu-img" title="Placeholder">
<img src="Icons/Superalgos/docs-placeholder-style.png" class="menu-img" title="Placeholder">
</div>
<div class="menu-item" onClick="window.contextMenu.toSummary()">
<img src="Icons/Superalgos/docs-summary-style.png" class="menu-img" title="Summary">
@@ -13,6 +13,72 @@
{
"style": "Error",
"text": "Unexpected Error"
},
{
"style": "Title",
"text": "Error Details",
"updated": 1611258020914
},
{
"style": "Text",
"text": "In the following section you will find the specific information received when this error occured."
},
{
"style": "Success",
"text": "You will only see it if you opened this page as a result of the error actually happening.",
"updated": 1611258030660
},
{
"style": "Subtitle",
"text": "Error Message"
},
{
"style": "Text",
"text": "The following is the Error Message of the Exception that occured at the TS:"
},
{
"style": "Placeholder",
"text": "errorMessage"
},
{
"style": "Subtitle",
"text": "Error Stack"
},
{
"style": "Text",
"text": "The following is the Error Stack of the Exception that occured at the TS:"
},
{
"style": "Placeholder",
"text": "errorStack"
},
{
"style": "Subtitle",
"text": "Error Code"
},
{
"style": "Text",
"text": "The follwing is the Error Code of the Exception that occured at the TS:"
},
{
"style": "Placeholder",
"text": "errorCode"
},
{
"style": "Subtitle",
"text": "Error Details"
},
{
"style": "Text",
"text": "The follwing are all the Error details of the Exception that occured at the TS:"
},
{
"style": "Placeholder",
"text": "errorDetails"
},
{
"style": "Text",
"text": ""
}
]
}
@@ -68,6 +68,23 @@
"style": "Placeholder",
"text": "errorCode"
},
{
"style": "Subtitle",
"text": "Error Details"
},
{
"style": "Text",
"text": "The follwing are all the Error details of the Exception that occured at the TS:",
"updated": 1611257840235
},
{
"style": "Placeholder",
"text": "errorDetails"
},
{
"style": "Text",
"text": ""
},
{
"style": "Text",
"text": ""
@@ -58,6 +58,7 @@
function run(callBackFunction) {
try {
require ('CACA')
loop()
function loop() {
@@ -43,6 +43,10 @@ exports.newSuperalgosFunctionLibrariesNodeJSFunctions = function () {
text: TS.projects.superalgos.globals.taskVariables.UNEXPECTED_ERROR.code
}
}
docs.placeholder.errorDetails = {
style: 'Json',
text: JSON.stringify(TS.projects.superalgos.globals.taskVariables.UNEXPECTED_ERROR, undefined, 4)
}
}
if (TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE || TS.projects.superalgos.globals.taskVariables.UNEXPECTED_ERROR) {
@@ -25,6 +25,7 @@ function newUiObjectMessage() {
thisObject.container.frame.radius = 0
let selfMouseClickEventSubscriptionId
let hoverAnimationCounter = 0
return thisObject
@@ -50,6 +51,7 @@ function newUiObjectMessage() {
function getContainer(point) {
if (thisObject.text === undefined) { return }
if (thisObject.container.frame.isThisPointHere(point, true) === true) {
hoverAnimationCounter = 30
return thisObject.container
} else {
return undefined
@@ -68,6 +70,11 @@ function newUiObjectMessage() {
thisObject.container.frame.width = FRAME_WIDTH
thisObject.container.frame.height = FRAME_HEIGHT
hoverAnimationCounter--
if (hoverAnimationCounter < 0) {
hoverAnimationCounter = 0
}
}
function onMouseClick(event) {
@@ -120,15 +127,29 @@ function newUiObjectMessage() {
}
}
function drawMessageBackground(borderColor) {
function drawMessageBackground(color) {
if (thisObject.text === undefined) { return }
let backgroundColor
let borderColor
let lineWidth
if (hoverAnimationCounter > 0 && thisObject.docs !== undefined) {
backgroundColor = UI_COLOR.LIGHT_GREY
borderColor = color
lineWidth = 2
} else {
backgroundColor = UI.projects.superalgos.spaces.floatingSpace.style.backgroundColor
borderColor = color
lineWidth = 0.5
}
let params = {
cornerRadius: 5,
lineWidth: 0.5,
cornerRadius: 10,
lineWidth: lineWidth,
container: thisObject.container,
borderColor: borderColor,
backgroundColor: UI.projects.superalgos.spaces.floatingSpace.style.backgroundColor,
backgroundColor: backgroundColor,
castShadow: false,
opacity: 0.75
}