File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
r2mm/installing/profile_installers Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import FileUtils from '../utils/FileUtils';
10
10
import { MODLOADER_PACKAGES } from '../r2mm/installing/profile_installers/ModLoaderVariantRecord' ;
11
11
import { PackageLoader } from '../model/installing/PackageLoader' ;
12
12
import FileWriteError from '../model/errors/FileWriteError' ;
13
+ import R2Error from '../model/errors/R2Error' ;
13
14
14
15
export class GDWeaveInstaller implements PackageInstaller {
15
16
async install ( args : InstallArgs ) {
@@ -105,7 +106,10 @@ export class GDWeavePluginInstaller implements PackageInstaller {
105
106
// not at the top level (because the top level is Thunderstore's packaging)
106
107
const modFolderInCache = await searchForManifest ( args . packagePath ) ;
107
108
if ( ! modFolderInCache ) {
108
- throw new Error ( 'Could not find mod folder' ) ;
109
+ throw new R2Error (
110
+ 'Could not find mod folder' ,
111
+ 'Either the mod package is malformed, or the files extracted to cache are corrupted'
112
+ ) ;
109
113
}
110
114
111
115
const modFolderInProfile = this . getModFolderInProfile ( args ) ;
Original file line number Diff line number Diff line change @@ -171,8 +171,12 @@ export default class GenericProfileInstaller extends ProfileInstallerProvider {
171
171
const pluginInstaller = GetInstallerIdForPlugin ( GameManager . activeGame . packageLoader ) ;
172
172
173
173
if ( pluginInstaller !== null ) {
174
- await PackageInstallers [ pluginInstaller ] . install ( args ) ;
175
- return Promise . resolve ( null ) ;
174
+ try {
175
+ await PackageInstallers [ pluginInstaller ] . install ( args ) ;
176
+ return Promise . resolve ( null ) ;
177
+ } catch ( e ) {
178
+ return Promise . resolve ( R2Error . fromThrownValue ( e ) ) ;
179
+ }
176
180
}
177
181
178
182
// Revert to legacy install behavior.
You can’t perform that action at this time.
0 commit comments