better error handling

This commit is contained in:
vss-devel 2019-07-15 11:01:52 +03:00
parent ba267f3df7
commit 530f511c90

View File

@ -996,15 +996,19 @@ async function loadPreRequisites () {
}
async function getSiteInfo () {
const resp = await api ({
action: 'query',
meta: 'siteinfo',
siprop: 'general|namespaces|namespacealiases',
})
try {
const resp = await api ({
action: 'query',
meta: 'siteinfo',
siprop: 'general|namespaces|namespacealiases',
})
const info = resp.query
log( 'SiteInfo', info )
wiki.info = info
const info = resp.query
log( 'SiteInfo', info )
wiki.info = info
} catch ( err ) {
fatal( 'SiteInfo error', err )
}
wiki.indexUrl = info.general.script
wiki.mainPage = info.general.mainpage
wiki.articlePath = info.general.articlepath.split('$')[0]