Debug metadata parsing
This commit is contained in:
@@ -142,17 +142,19 @@ metadata.plugin = async function({__plugins, name, logger}) {
|
|||||||
}
|
}
|
||||||
//JSON
|
//JSON
|
||||||
case "json": {
|
case "json": {
|
||||||
console.log("DEBUG: ", value)
|
if (typeof value === "object")
|
||||||
|
return value
|
||||||
|
console.log("DEBUG1: ", value)
|
||||||
try {
|
try {
|
||||||
value = JSON.parse(value)
|
value = JSON.parse(value)
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
console.log("DEBUG: ", error)
|
console.log("DEBUG2: ", error)
|
||||||
try {
|
try {
|
||||||
value = JSON.parse(decodeURIComponent(value))
|
value = JSON.parse(decodeURIComponent(value))
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
console.log("DEBUG: ", error)
|
console.log("DEBUG3: ", error)
|
||||||
logger(`metrics/inputs > failed to parse json : ${value}`)
|
logger(`metrics/inputs > failed to parse json : ${value}`)
|
||||||
value = JSON.parse(defaulted)
|
value = JSON.parse(defaulted)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user