@@ -65,13 +65,29 @@ await Parallel.ForEachAsync(AssetIndex,
6565
6666 ValueTask Impl ( FilePropertiesRemote asset , CancellationToken token )
6767 {
68- return asset switch
68+ try
6969 {
70- { AssociatedObject : SophonAsset } => RepairAssetGenericSophonType ( asset , token ) ,
71- { FT : FileType . Audio } => RepairAssetAudioType ( asset , token ) ,
72- { FT : FileType . Block } => RepairAssetBlockType ( asset , token ) ,
73- _ => RepairAssetGenericType ( GetHttpClientFromFilename ( asset ) , asset , token )
74- } ;
70+ return asset switch
71+ {
72+ { AssociatedObject : SophonAsset } => RepairAssetGenericSophonType ( asset , token ) ,
73+ { FT : FileType . Audio } => RepairAssetAudioType ( asset , token ) ,
74+ { FT : FileType . Block } => RepairAssetBlockType ( asset , token ) ,
75+ _ => RepairAssetGenericType ( GetHttpClientFromFilename ( asset ) , asset , token )
76+ } ;
77+ }
78+ catch ( HttpRequestException httpEx )
79+ {
80+ string message = "An HTTP error has occurred while trying to download this following asset:" +
81+ $ """
82+ Asset Path: { asset . N }
83+ Asset Remote URL: { asset . RN }
84+ Asset Size: { asset . S }
85+ Asset Hash: { asset . CRC }
86+ Type: { asset . FT }
87+ Object Association: { ( asset . AssociatedObject is var obj ? obj . GetType ( ) . Name : "GenericDownload" ) }
88+ """ ;
89+ throw new HttpRequestException ( httpEx . HttpRequestError , message , httpEx , httpEx . StatusCode ) ;
90+ }
7591 }
7692
7793 HttpClient GetHttpClientFromFilename ( FilePropertiesRemote asset )
0 commit comments