mirror of
https://github.com/yuzu-emu/liftinstall.git
synced 2024-11-25 17:25:41 +01:00
ui: main: more robust error handling in /app/exit
This commit is contained in:
parent
cd7fb8de28
commit
34fd140a9e
@ -5,6 +5,7 @@ const app = express()
|
|||||||
const port = 3000
|
const port = 3000
|
||||||
|
|
||||||
let showError = false
|
let showError = false
|
||||||
|
let showConfigError = false
|
||||||
let maintenance = false
|
let maintenance = false
|
||||||
let launcher = false
|
let launcher = false
|
||||||
let fileExists = false
|
let fileExists = false
|
||||||
@ -30,7 +31,7 @@ function progressSimulation (res) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function returnConfig (res) {
|
function returnConfig (res) {
|
||||||
if (showError) {
|
if (showConfigError) {
|
||||||
res.status(500).json({})
|
res.status(500).json({})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -144,6 +145,14 @@ process.argv.forEach((val, index) => {
|
|||||||
darkMode = true
|
darkMode = true
|
||||||
console.log('Simulating dark mode')
|
console.log('Simulating dark mode')
|
||||||
break
|
break
|
||||||
|
case 'config-error':
|
||||||
|
showConfigError = true
|
||||||
|
console.log('Simulating configuration errors')
|
||||||
|
break
|
||||||
|
case 'error':
|
||||||
|
showError = true
|
||||||
|
console.log('Simulating errors')
|
||||||
|
break
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ var app = new Vue({
|
|||||||
methods: {
|
methods: {
|
||||||
exit: function () {
|
exit: function () {
|
||||||
axios.get('/api/exit').catch(function (msg) {
|
axios.get('/api/exit').catch(function (msg) {
|
||||||
var searchLocation = app.metadata.install_path.length > 0 ? app.metadata.install_path
|
var searchLocation = (app.metadata.install_path && app.metadata.install_path.length > 0) ? app.metadata.install_path
|
||||||
: i18n.t('error.location_unknown')
|
: i18n.t('error.location_unknown')
|
||||||
|
|
||||||
app.$router.replace({
|
app.$router.replace({
|
||||||
|
Loading…
Reference in New Issue
Block a user