chore: code formatting
This commit is contained in:
@@ -74,7 +74,7 @@
|
||||
//Metrics embed
|
||||
async embed() {
|
||||
window.location.href = `/embed?user=${this.user2}`
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
})
|
||||
})()
|
||||
|
||||
@@ -97,7 +97,7 @@ export default async function({login, data, rest, imports, q, account}, {enabled
|
||||
}
|
||||
|
||||
//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
|
||||
console.debug(`metrics/compute/${login}/plugins > habits > searching recently used languages using linguist`)
|
||||
if (patches.length) {
|
||||
|
||||
@@ -47,13 +47,18 @@ export default async function({login, imports, data, q, account}, {enabled = fal
|
||||
}
|
||||
//Handle errors
|
||||
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
|
||||
if (description) {
|
||||
const status = error.response?.status
|
||||
return `API error: ${status} (${description})`
|
||||
}
|
||||
return null
|
||||
}}})
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,10 +66,14 @@ export default async function({login, data, imports, graphql, q, queries, accoun
|
||||
}
|
||||
//Handle errors
|
||||
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"))
|
||||
return "Insufficient token scopes"
|
||||
return null
|
||||
}}})
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user