Merge pull request #490 from Luis-Fernando-Molina/develop
Contribution: Error Handling Improved at Exchage API modeule / Integration with the Docs
This commit is contained in:
6 files changed
+718
-19
No files matched your search
+136
@@ -0,0 +1,136 @@
|
||||
{
|
||||
"topic": "TS LF Trading Bot Errors",
|
||||
"pageNumber": "54",
|
||||
"type": "TS LF Trading Bot Error - Invalid Exchange API Key",
|
||||
"definition": {
|
||||
"text": "The Exchange API Key you provided to access the Exchange was not recognized by the Exchange as a valid key.",
|
||||
"updated": 1611737158370
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Success",
|
||||
"text": "Double check that you copied the key at the codeName property and the secret at secret property without bringing any invisible caracter from the exchange web site, or leaving any character from the sample text. Also check that the keys are not disabled at the exchange ot that they are not restricted by IP.",
|
||||
"updated": 1611737047835
|
||||
},
|
||||
{
|
||||
"style": "Error",
|
||||
"text": "Invalid Exchange API Key",
|
||||
"updated": 1611737063601
|
||||
},
|
||||
{
|
||||
"style": "Title",
|
||||
"text": "Error Details"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "In the following section you will find the specific information received when this error occured."
|
||||
},
|
||||
{
|
||||
"style": "Note",
|
||||
"text": "You will only see it if you opened this page as a result of the error actually happening.",
|
||||
"updated": 1611737076496
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Message"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Message of the Exception that occured at the LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"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 LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"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 LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"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 LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorDetails"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Node Name"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The follwing is the node's name of the Node most related to this error:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "nodeName"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Node Code"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The follwing is the code stored at the node that produced the error at the LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "nodeCode"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Node Config",
|
||||
"updated": 1611738263645
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The follwing is the config stored at the node that produced the error at the LF Trading Bot:",
|
||||
"updated": 1611738289813
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "nodeConfig"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Context Info"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The follwing is the context information preserved when the error occured:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "contextInfo"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
+135
@@ -0,0 +1,135 @@
|
||||
{
|
||||
"topic": "TS LF Trading Bot Errors",
|
||||
"pageNumber": "55",
|
||||
"type": "TS LF Trading Bot Error - Invalid Exchange API Secret",
|
||||
"definition": {
|
||||
"text": "The secret belonging to the Exchange API Key you provided was not recongnized by the Exchange as a valid one.",
|
||||
"updated": 1611737028486
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Success",
|
||||
"text": "Double check that you copied the key at the codeName property and the secret at secret property without bringing any invisible caracter from the exchange web site, or leaving any character from the sample text. Also check that the keys are not disabled at the exchange ot that they are not restricted by IP.",
|
||||
"updated": 1611736867050
|
||||
},
|
||||
{
|
||||
"style": "Error",
|
||||
"text": "Invalid Exchange API Secret",
|
||||
"updated": 1611736901469
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Details"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "In the following section you will find the specific information received when this error occured."
|
||||
},
|
||||
{
|
||||
"style": "Note",
|
||||
"text": "You will only see it if you opened this page as a result of the error actually happening.",
|
||||
"updated": 1611736919043
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Message"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Message of the Exception that occured at the LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"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 LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"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 LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"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 LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorDetails"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Node Name"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The follwing is the node's name of the Node most related to this error:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "nodeName"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Node Code"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The follwing is the code stored at the node that produced the error at the LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "nodeCode"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Node Config",
|
||||
"updated": 1611738357587
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The follwing is the config stored at the node that produced the error at the LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "nodeConfig"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Context Info"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The follwing is the context information preserved when the error occured:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "contextInfo"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
+125
@@ -0,0 +1,125 @@
|
||||
{
|
||||
"topic": "TS LF Trading Bot Errors",
|
||||
"pageNumber": "56",
|
||||
"type": "TS LF Trading Bot Error - Get Order Unexpected Error",
|
||||
"definition": {
|
||||
"text": "Write a summary for this topic page."
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Getting an order means sending a request to the exchange via it's API to give us the order information. There are many different reasons why this can fail. Some of those reasons are under your control, and some are not. Some might be temporaly unavailability of the exchange servers, communication, network, or other issues. Below you can find the error details which will help you understand the nature of the problem. The LF Trading Bot expects that some issue may happens and has logic to handle these problems and continue operating.",
|
||||
"updated": 1611736716112
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": ""
|
||||
},
|
||||
{
|
||||
"style": "Error",
|
||||
"text": "Get Order Unexpected Error",
|
||||
"updated": 1611736734990
|
||||
},
|
||||
{
|
||||
"style": "Title",
|
||||
"text": "Error Details"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "In the following section you will find the specific information received when this error occured."
|
||||
},
|
||||
{
|
||||
"style": "Note",
|
||||
"text": "You will only see it if you opened this page as a result of the error actually happening.",
|
||||
"updated": 1611736750115
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Message"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Message of the Exception that occured at the LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"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 LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"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 LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"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 LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorDetails"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Node Name"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The follwing is the node's name of the Node most related to this error:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "nodeName"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Node Code"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The follwing is the code stored at the node that produced the error at the LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "nodeCode"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Context Info"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The follwing is the context information preserved when the error occured:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "contextInfo"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
{
|
||||
"topic": "TS LF Trading Bot Errors",
|
||||
"pageNumber": "57",
|
||||
"type": "TS LF Trading Bot Error - Cancel Order Unexpected Error",
|
||||
"definition": {
|
||||
"text": "An Uncexpected Error occured while trying to cancel an order at the exchange. The LF Trading Bot continued running after reporting this error.",
|
||||
"updated": 1611736350925
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Cancelling an order means sending a request to the exchange via it's API to cancel the order. There are many different reasons why this can fail. Some of those reasons are under your control, and some are not. Some might be temporaly unavailability of the exchange servers, communication, network, or other issues. Below you can find the error details which will help you understand the nature of the problem. The LF Trading Bot expects that some issue may happens and has logic to handle these problems and continue operating.",
|
||||
"updated": 1611736616811
|
||||
},
|
||||
{
|
||||
"style": "Error",
|
||||
"text": "Cancel Order Unexpected Error",
|
||||
"updated": 1611736368660
|
||||
},
|
||||
{
|
||||
"style": "Title",
|
||||
"text": "Error Details"
|
||||
},
|
||||
{
|
||||
"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": 1611736382407
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Message"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Message of the Exception that occured at the LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"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 LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"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 LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"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 LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorDetails"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Node Name"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The follwing is the node's name of the Node most related to this error:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "nodeName"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Node Code"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The follwing is the code stored at the node that produced the error at the LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "nodeCode"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Context Info"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The follwing is the context information preserved when the error occured:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "contextInfo"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
{
|
||||
"topic": "TS LF Trading Bot Errors",
|
||||
"pageNumber": "58",
|
||||
"type": "TS LF Trading Bot Error - Create Order Unexpected Error",
|
||||
"definition": {
|
||||
"text": "An Uncexpected Error occured while trying to cancel an order at the exchange. The LF Trading Bot continued running after reporting this error.",
|
||||
"updated": 1611736350925
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Creating an order means sending a request to the exchange via it's API to create the order. There are many different reasons why this can fail. Some of those reasons are under your control, and some are not. Some might be temporaly unavailability of the exchange servers, communication, network, or other issues. Below you can find the error details which will help you understand the nature of the problem. The LF Trading Bot expects that some issue may happens and has logic to handle these problems and continue operating.",
|
||||
"updated": 1611736616811
|
||||
},
|
||||
{
|
||||
"style": "Error",
|
||||
"text": "Cancel Order Unexpected Error",
|
||||
"updated": 1611736368660
|
||||
},
|
||||
{
|
||||
"style": "Title",
|
||||
"text": "Error Details"
|
||||
},
|
||||
{
|
||||
"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": 1611736382407
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Message"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Message of the Exception that occured at the LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"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 LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"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 LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"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 LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorDetails"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Node Name"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The follwing is the node's name of the Node most related to this error:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "nodeName"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Node Code"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The follwing is the code stored at the node that produced the error at the LF Trading Bot:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "nodeCode"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Context Info"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The follwing is the context information preserved when the error occured:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "contextInfo"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
+78
-19
@@ -24,9 +24,9 @@
|
||||
tradingSystem = TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).SIMULATION_STATE.tradingSystem
|
||||
|
||||
exchangeId = TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name.toLowerCase()
|
||||
|
||||
let key
|
||||
let secret
|
||||
|
||||
let key
|
||||
let secret
|
||||
|
||||
if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.keyReference !== undefined) {
|
||||
if (TS.projects.superalgos.globals.taskConstants.TASK_NODE.keyReference.referenceParent !== undefined) {
|
||||
@@ -41,7 +41,7 @@
|
||||
'timeout': 30000,
|
||||
'enableRateLimit': true,
|
||||
verbose: false,
|
||||
'adjustForTimeDifference': true,
|
||||
'adjustForTimeDifference': true,
|
||||
options: options
|
||||
}
|
||||
exchange = new exchangeClass(exchangeConstructorParams)
|
||||
@@ -75,7 +75,22 @@
|
||||
logInfo("getOrder -> Response from the Exchange: " + JSON.stringify(order));
|
||||
return order
|
||||
} catch (err) {
|
||||
tradingSystem.errors.push([tradingSystemOrder.id, "getOrder -> Error = " + err.message])
|
||||
const message = 'Get Order Unexpected Error'
|
||||
let docs = {
|
||||
project: 'Superalgos',
|
||||
category: 'Topic',
|
||||
type: 'TS LF Trading Bot Error - ' + message,
|
||||
placeholder: {}
|
||||
}
|
||||
let contextInfo = {
|
||||
symbol: symbol,
|
||||
orderId: orderId
|
||||
}
|
||||
|
||||
TS.projects.superalgos.utilities.docsFunctions.buildPlaceholder(docs, err, tradingSystemOrder.name, undefined, undefined, undefined, contextInfo)
|
||||
|
||||
tradingSystem.errors.push([tradingSystemOrder.id, message, docs])
|
||||
|
||||
logError("getOrder -> Error = " + err.message);
|
||||
}
|
||||
}
|
||||
@@ -134,7 +149,10 @@
|
||||
logInfo("createOrder -> Response from the Exchange: " + JSON.stringify(order));
|
||||
return order.id
|
||||
} catch (err) {
|
||||
tradingSystem.errors.push([tradingSystemOrder.id, "createOrder -> Error = " + err.message])
|
||||
|
||||
let exchangeApiKey = TS.projects.superalgos.globals.taskConstants.TASK_NODE.keyReference.referenceParent
|
||||
let message = 'Create Order Unexpected Error'
|
||||
|
||||
logError("createOrder -> Error = " + err.message)
|
||||
logError("createOrder -> symbol = " + symbol);
|
||||
logError("createOrder -> side = " + side);
|
||||
@@ -142,27 +160,54 @@
|
||||
logError("createOrder -> amount = " + amount);
|
||||
logError("createOrder -> price = " + price);
|
||||
if (
|
||||
err.message.indexOf('API-key format invalid') >= 0 ||
|
||||
err.message.indexOf('API-key format invalid') >= 0 ||
|
||||
err.message.indexOf('Invalid API-key, IP, or permissions for action.') >= 0 ||
|
||||
err.message.indexOf('"code":-2015') >= 0
|
||||
) {
|
||||
logError ('The exchange says the API key provided is not good or it is not in the correct format. This is what you are using:')
|
||||
) {
|
||||
logError('The exchange says the API key provided is not good or it is not in the correct format. This is what you are using:')
|
||||
errorFooter()
|
||||
|
||||
message = 'Invalid Exchange API Key'
|
||||
}
|
||||
if (
|
||||
err.message.indexOf('Signature for this request is not valid.') >= 0 ||
|
||||
err.message.indexOf('"code":-1022') >= 0
|
||||
) {
|
||||
logError ('The exchange says the secret provided is not good, incorrect or not in the correct format. This is what you are using:')
|
||||
) {
|
||||
logError('The exchange says the secret provided is not good, incorrect or not in the correct format. This is what you are using:')
|
||||
errorFooter()
|
||||
|
||||
message = 'Invalid Exchange API Secret'
|
||||
}
|
||||
function errorFooter(){
|
||||
logError ('key: ->' + TS.projects.superalgos.globals.taskConstants.TASK_NODE.keyReference.referenceParent.config.codeName + '<-')
|
||||
logError ('secret: ->' + TS.projects.superalgos.globals.taskConstants.TASK_NODE.keyReference.referenceParent.config.secret + '<-')
|
||||
logError ('key.length:' + TS.projects.superalgos.globals.taskConstants.TASK_NODE.keyReference.referenceParent.config.codeName.length )
|
||||
logError ('secret.length:' + TS.projects.superalgos.globals.taskConstants.TASK_NODE.keyReference.referenceParent.config.secret.length )
|
||||
logError ('Double check that you copied the key at the codeName property and the secret at secret property without bringing any invisible caracter from the exchange web site, or leaving any character from the sample text. Also check that the keys are not disabled at the exchange ot that they are not restricted by IP.')
|
||||
logError ('As a remainder. Binance key and secret are 64 bytes in lenght each one. ' )
|
||||
|
||||
let docs = {
|
||||
project: 'Superalgos',
|
||||
category: 'Topic',
|
||||
type: 'TS LF Trading Bot Error - ' + message,
|
||||
placeholder: {}
|
||||
}
|
||||
|
||||
let contextInfo = {
|
||||
symbol: symbol,
|
||||
side: side,
|
||||
type: type,
|
||||
amount: amount,
|
||||
price: price,
|
||||
key: exchangeApiKey.config.codeName,
|
||||
secret: exchangeApiKey.config.secret,
|
||||
keyLength: exchangeApiKey.config.codeName.length,
|
||||
secretLength: exchangeApiKey.config.secret.length
|
||||
}
|
||||
TS.projects.superalgos.utilities.docsFunctions.buildPlaceholder(docs, err, exchangeApiKey.name, undefined, exchangeApiKey.config, undefined, contextInfo)
|
||||
|
||||
tradingSystem.errors.push([exchangeApiKey.id, message, docs])
|
||||
|
||||
function errorFooter() {
|
||||
logError('key: ->' + exchangeApiKey.config.codeName + '<-')
|
||||
logError('secret: ->' + exchangeApiKey.config.secret + '<-')
|
||||
logError('key.length:' + exchangeApiKey.config.codeName.length)
|
||||
logError('secret.length:' + exchangeApiKey.config.secret.length)
|
||||
logError('Double check that you copied the key at the codeName property and the secret at secret property without bringing any invisible caracter from the exchange web site, or leaving any character from the sample text. Also check that the keys are not disabled at the exchange ot that they are not restricted by IP.')
|
||||
logError('As a remainder. Binance key and secret are 64 bytes in lenght each one. ')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -188,7 +233,21 @@
|
||||
logInfo("cancelOrder -> Response from the Exchange: " + JSON.stringify(order));
|
||||
return true
|
||||
} catch (err) {
|
||||
tradingSystem.errors.push([tradingSystemOrder.id, "cancelOrder -> Error = " + err.message])
|
||||
const message = 'Cancel Order Unexpected Error'
|
||||
let docs = {
|
||||
project: 'Superalgos',
|
||||
category: 'Topic',
|
||||
type: 'TS LF Trading Bot Error - ' + message,
|
||||
placeholder: {}
|
||||
}
|
||||
let contextInfo = {
|
||||
symbol: symbol,
|
||||
orderId: orderId
|
||||
}
|
||||
|
||||
TS.projects.superalgos.utilities.docsFunctions.buildPlaceholder(docs, err, tradingSystemOrder.name, undefined, undefined, undefined, contextInfo)
|
||||
|
||||
tradingSystem.errors.push([tradingSystemOrder.id, message, docs])
|
||||
logError("cancelOrder -> Error = " + err.message);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user