@@ -510,7 +510,7 @@ private static async Task<JvmArgRes> MakeJvmArgAsync(this GameSettingObj obj, Lo
510510 var res = await CoreHttpClient . GetStringAsync ( login . Text1 ) ;
511511 if ( ! res . State )
512512 {
513- throw new LaunchException ( LaunchState . LoginCoreError ) ;
513+ throw new LaunchException ( LaunchError . LoginCoreError ) ;
514514 }
515515 jvm . Add ( $ "-javaagent:{ AuthlibHelper . NowAuthlibInjector } ={ login . Text1 } ") ;
516516 jvm . Add ( $ "-Dauthlibinjector.yggdrasil.prefetched={ HashHelper . GenBase64 ( res . Data ! ) } ") ;
@@ -520,7 +520,7 @@ private static async Task<JvmArgRes> MakeJvmArgAsync(this GameSettingObj obj, Lo
520520 res = await CoreHttpClient . GetStringAsync ( $ "{ UrlHelper . LittleSkin } api/yggdrasil") ;
521521 if ( ! res . State )
522522 {
523- throw new LaunchException ( LaunchState . LoginCoreError ) ;
523+ throw new LaunchException ( LaunchError . LoginCoreError ) ;
524524 }
525525 jvm . Add ( $ "-javaagent:{ AuthlibHelper . NowAuthlibInjector } ={ UrlHelper . LittleSkin } api/yggdrasil") ;
526526 jvm . Add ( $ "-Dauthlibinjector.yggdrasil.prefetched={ HashHelper . GenBase64 ( res . Data ! ) } ") ;
@@ -530,7 +530,7 @@ private static async Task<JvmArgRes> MakeJvmArgAsync(this GameSettingObj obj, Lo
530530 res = await CoreHttpClient . GetStringAsync ( $ "{ login . Text1 } api/yggdrasil") ;
531531 if ( ! res . State )
532532 {
533- throw new LaunchException ( LaunchState . LoginCoreError ) ;
533+ throw new LaunchException ( LaunchError . LoginCoreError ) ;
534534 }
535535 jvm . Add ( $ "-javaagent:{ AuthlibHelper . NowAuthlibInjector } ={ login . Text1 } /api/yggdrasil") ;
536536 jvm . Add ( $ "-Dauthlibinjector.yggdrasil.prefetched={ HashHelper . GenBase64 ( res . Data ! ) } ") ;
@@ -675,7 +675,7 @@ public static List<string> MakeRunArg(this GameSettingObj obj, GameLaunchArg lar
675675 private static string MakeMainClass ( this GameSettingObj obj )
676676 {
677677 var version = VersionPath . GetVersion ( obj . Version )
678- ?? throw new LaunchException ( LaunchState . LostVersion ) ;
678+ ?? throw new LaunchException ( LaunchError . LostVersionFile ) ;
679679 var v2 = version . IsGameVersionV2 ( ) ;
680680 if ( ! string . IsNullOrWhiteSpace ( obj . AdvanceJvm ? . MainClass ) )
681681 {
@@ -776,7 +776,7 @@ await Task.Run(async () =>
776776 if ( res2 == null )
777777 {
778778 res2 = await obj . BuildForgeAsync ( )
779- ?? throw new LaunchException ( LaunchState . LostLoader ) ;
779+ ?? throw new LaunchException ( LaunchError . LostLoaderFile ) ;
780780 }
781781 loader = res2 . Loaders ;
782782 install = res2 . Installs ;
@@ -793,7 +793,7 @@ await Task.Run(async () =>
793793 return ;
794794 }
795795 loader ??= await obj . BuildFabricAsync ( )
796- ?? throw new LaunchException ( LaunchState . LostLoader ) ;
796+ ?? throw new LaunchException ( LaunchError . LostLoaderFile ) ;
797797 break ;
798798 case Loaders . Quilt :
799799 loader = obj . GetQuiltLibs ( ) ;
@@ -802,7 +802,7 @@ await Task.Run(async () =>
802802 return ;
803803 }
804804 loader ??= await obj . BuildQuiltAsync ( )
805- ?? throw new LaunchException ( LaunchState . LostLoader ) ;
805+ ?? throw new LaunchException ( LaunchError . LostLoaderFile ) ;
806806 break ;
807807 case Loaders . OptiFine :
808808 loader = obj . GetOptifineLibs ( ) ;
@@ -811,22 +811,22 @@ await Task.Run(async () =>
811811 return ;
812812 }
813813 loader ??= await obj . BuildOptifineAsync ( )
814- ?? throw new LaunchException ( LaunchState . LostLoader ) ;
814+ ?? throw new LaunchException ( LaunchError . LostLoaderFile ) ;
815815 GameHelper . ReadyOptifineWrapper ( ) ;
816816 loader . Add ( GameHelper . OptifineWrapper ) ;
817817 break ;
818818 case Loaders . Custom :
819819 if ( obj . CustomLoader == null || ! File . Exists ( obj . GetGameLoaderFile ( ) ) )
820820 {
821- throw new LaunchException ( LaunchState . LostLoader ) ;
821+ throw new LaunchException ( LaunchError . LostLoaderFile ) ;
822822 }
823823
824824 if ( cancel . IsCancellationRequested )
825825 {
826826 return ;
827827 }
828828 var res1 = await GameDownloadHelper . DecodeLoaderJarAsync ( obj , obj . GetGameLoaderFile ( ) , cancel )
829- ?? throw new LaunchException ( LaunchState . LostLoader ) ;
829+ ?? throw new LaunchException ( LaunchError . LostLoaderFile ) ;
830830 loader = res1 . List ? . ToList ( ) ;
831831 break ;
832832 }
@@ -892,7 +892,7 @@ await Task.Run(async () =>
892892 {
893893 //不存在json文件
894894 var res = await GameAPI . GetAssetsAsync ( game . AssetIndex . Url )
895- ?? throw new LaunchException ( LaunchState . AssetsError ) ;
895+ ?? throw new LaunchException ( LaunchError . LostAssetsFile , data : game . AssetIndex . Id ) ;
896896 assets = res . Assets ;
897897 game . AddIndex ( res . Text ) ;
898898 }
@@ -946,7 +946,7 @@ await Task.Run(async () =>
946946 if ( assets == null )
947947 {
948948 var res = await GameAPI . GetAssetsAsync ( item . AssetIndex . Url )
949- ?? throw new LaunchException ( LaunchState . AssetsError ) ;
949+ ?? throw new LaunchException ( LaunchError . LostAssetsFile , data : item . AssetIndex . Id ) ;
950950 assets = res . Assets ;
951951 item . AddIndex ( res . Text ) ;
952952 }
0 commit comments