chore: code formatting
This commit is contained in:
@@ -74,7 +74,7 @@
|
|||||||
//Metrics embed
|
//Metrics embed
|
||||||
async embed() {
|
async embed() {
|
||||||
window.location.href = `/embed?user=${this.user2}`
|
window.location.href = `/embed?user=${this.user2}`
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
})()
|
})()
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ export default async function({login, data, rest, imports, q, account}, {enabled
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Linguist
|
//Linguist
|
||||||
if ((charts)&&((imports.metadata.plugins.habits.extras("charts", {extras, error:false})))) {
|
if ((charts) && (imports.metadata.plugins.habits.extras("charts", {extras, error: false}))) {
|
||||||
//Check if linguist exists
|
//Check if linguist exists
|
||||||
console.debug(`metrics/compute/${login}/plugins > habits > searching recently used languages using linguist`)
|
console.debug(`metrics/compute/${login}/plugins > habits > searching recently used languages using linguist`)
|
||||||
if (patches.length) {
|
if (patches.length) {
|
||||||
|
|||||||
@@ -47,13 +47,18 @@ export default async function({login, imports, data, q, account}, {enabled = fal
|
|||||||
}
|
}
|
||||||
//Handle errors
|
//Handle errors
|
||||||
catch (error) {
|
catch (error) {
|
||||||
throw imports.format.error(error, {descriptions:{"429":'(consider using "plugin_pagespeed_token")', custom(error) {
|
throw imports.format.error(error, {
|
||||||
|
descriptions: {
|
||||||
|
"429": '(consider using "plugin_pagespeed_token")',
|
||||||
|
custom(error) {
|
||||||
const description = error.response?.data?.error?.message?.match(/Lighthouse returned error: (?<description>[A-Z_]+)/)?.groups?.description ?? null
|
const description = error.response?.data?.error?.message?.match(/Lighthouse returned error: (?<description>[A-Z_]+)/)?.groups?.description ?? null
|
||||||
if (description) {
|
if (description) {
|
||||||
const status = error.response?.status
|
const status = error.response?.status
|
||||||
return `API error: ${status} (${description})`
|
return `API error: ${status} (${description})`
|
||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
}}})
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,10 +66,14 @@ export default async function({login, data, imports, graphql, q, queries, accoun
|
|||||||
}
|
}
|
||||||
//Handle errors
|
//Handle errors
|
||||||
catch (error) {
|
catch (error) {
|
||||||
throw imports.format.error(error, {descriptions:{custom(error) {
|
throw imports.format.error(error, {
|
||||||
|
descriptions: {
|
||||||
|
custom(error) {
|
||||||
if (error.errors?.map(({type}) => type)?.includes("INSUFFICIENT_SCOPES"))
|
if (error.errors?.map(({type}) => type)?.includes("INSUFFICIENT_SCOPES"))
|
||||||
return "Insufficient token scopes"
|
return "Insufficient token scopes"
|
||||||
return null
|
return null
|
||||||
}}})
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user