[fix] added error logging when getting the steam version path (#890)

This commit is contained in:
silentrald
2025-07-01 14:54:22 +08:00
committed by GitHub
parent 06c242eb01
commit 46556cf3cc
@@ -244,8 +244,12 @@ export class BSLocalVersionService {
private async getSteamVersion(): Promise<BSVersion> {
const steamBsFolder = await this.steamService.getGameFolder(BS_APP_ID, "Beat Saber");
if (!steamBsFolder || !(await pathExists(steamBsFolder))) {
return null;
if (!steamBsFolder) {
throw new Error("No Beat Saber Steam version found");
}
if (!(await pathExists(steamBsFolder))) {
throw new Error(`Beat Saber Steam version not found in "${steamBsFolder}"`);
}
return this.getVersionOfBSFolder(steamBsFolder, { steam: true });
@@ -265,7 +269,8 @@ export class BSLocalVersionService {
const versions: BSVersion[] = [];
const steamVersion = await this.getSteamVersion().catch(e => {
log.error("unable to get original Steam version", e);
log.error("Unable to get original Steam version", e);
return null;
});
if (steamVersion) {