fix: Throw object for XMLHttpRequest (#1166)

This commit is contained in:
Kroese
2026-05-29 16:54:45 +02:00
committed by GitHub
parent 7168f2f843
commit d5802607b5
2 changed files with 7 additions and 4 deletions

View File

@@ -264,12 +264,12 @@ convertDisk() {
local FS="$7"
[ -f "$DST_FILE" ] && error "Conversion failed, destination file $DST_FILE already exists?" && exit 79
[ ! -f "$SOURCE_FILE" ] && error "Conversion failed, source file $SOURCE_FILE does not exists?" && exit 79
[ ! -f "$SOURCE_FILE" ] && error "Conversion failed, source file $SOURCE_FILE does not exist?" && exit 79
local TMP_FILE="$DISK_BASE.tmp"
rm -f "$TMP_FILE"
local DIR
local DIR FA
DIR=$(dirname "$TMP_FILE")
if [[ "$ALLOCATE" != [Nn]* ]]; then
@@ -677,7 +677,10 @@ else
addDisk "$DISK4_FILE" "$DISK_TYPE" "disk4" "$DISK4_SIZE" "6" "0xf" "$DISK_FMT" "$DISK_IO" "$DISK_CACHE" || exit $?
fi
DISK_OPTS+=" -object iothread,id=io2"
case "${DISK_TYPE,,}" in
"blk" | "scsi" | "virtio-blk" | "virtio-scsi" )
DISK_OPTS+=" -object iothread,id=io2" ;;
esac
html "Initialized disks successfully..."
return 0

View File

@@ -14,7 +14,7 @@ function getInfo() {
if (window.XMLHttpRequest) {
request = new XMLHttpRequest();
} else {
throw "XMLHttpRequest not available!";
throw new Error("XMLHttpRequest not available!");
}
request.onreadystatechange = processInfo;