Error handling (#121)

This commit is contained in:
Geometrically
2023-05-22 18:11:31 -07:00
committed by GitHub
parent 6014172046
commit 1b47eb71e1
36 changed files with 271 additions and 198 deletions

View File

@@ -43,6 +43,7 @@ import {
find_jre_8_jres,
get_all_jre,
} from '@/helpers/jre.js'
import { handleError } from '@/store/notifications.js'
const chosenInstallOptions = ref([])
const detectJavaModal = ref(null)
@@ -52,14 +53,14 @@ defineExpose({
show: async (version, currentSelectedJava) => {
if (version <= 8 && !!version) {
console.log(version)
chosenInstallOptions.value = await find_jre_8_jres()
chosenInstallOptions.value = await find_jre_8_jres().catch(handleError)
} else if (version >= 18) {
chosenInstallOptions.value = await find_jre_18plus_jres()
chosenInstallOptions.value = await find_jre_18plus_jres().catch(handleError)
} else if (version) {
chosenInstallOptions.value = await find_jre_17_jres()
chosenInstallOptions.value = await find_jre_17_jres().catch(handleError)
} else {
console.log('get all')
chosenInstallOptions.value = await get_all_jre()
chosenInstallOptions.value = await get_all_jre().catch(handleError)
}
currentSelected.value = currentSelectedJava