Merge pull request #438 from Luis-Fernando-Molina/develop

Contribution: Improvements in Error Handlng / Error UX
This commit is contained in:
Luis Fernando Molina authored and GitHub committed 2021-01-21 20:58:37 +01:00
commit 9e30cb8fcc
8 files changed
+122 -9

No files matched your search

@@ -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": ""
@@ -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) {
@@ -62,10 +62,13 @@ function newSuperalgosDocsCommmandInterface() {
return
}
message = message.replaceAll('#', '_HASHTAG_')
message = message.replaceAll('/', '_SLASH_')
httpRequest(
undefined,
'App/Contribute/' +
message.replaceAll('#', 'HASHTAG') + '/' +
message + '/' +
config.username + '/' +
config.token + '/' +
UI.projects.superalgos.spaces.docsSpace.currentBranch + '/' +
@@ -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
}