mirror of
https://github.com/yuzu-emu/liftinstall.git
synced 2024-11-09 16:38:32 +00: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
|
||||
|
||||
let showError = false
|
||||
let showConfigError = false
|
||||
let maintenance = false
|
||||
let launcher = false
|
||||
let fileExists = false
|
||||
|
@ -30,7 +31,7 @@ function progressSimulation (res) {
|
|||
}
|
||||
|
||||
function returnConfig (res) {
|
||||
if (showError) {
|
||||
if (showConfigError) {
|
||||
res.status(500).json({})
|
||||
return
|
||||
}
|
||||
|
@ -144,6 +145,14 @@ process.argv.forEach((val, index) => {
|
|||
darkMode = true
|
||||
console.log('Simulating dark mode')
|
||||
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: {
|
||||
exit: function () {
|
||||
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')
|
||||
|
||||
app.$router.replace({
|
||||
|
|
Loading…
Reference in a new issue