Skip to content

Commit

Permalink
Improve typings to prevent introducing bugs in the future
Browse files Browse the repository at this point in the history
  • Loading branch information
VilppeRiskidev committed Oct 29, 2024
1 parent 153f32c commit 79289a1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/r2mm/mods/ProfileImportExport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@ async function downloadProfileCode(profileCode: string): Promise<string> {
5,
1000,
() => { return !is404 },
(e: any) => {
(e: unknown) => {
console.error(e);
if (e.message.startsWith("404")) {
if (R2Error.fromThrownValue(e).message.startsWith("404")) {
is404 = true;
}
},
true
);
return saveDownloadedProfile(response.data);
} catch (e: any) {
if (e.message === "Network Error") {
} catch (e: unknown) {
if (e instanceof Error && e.message === "Network Error") {
throw new R2Error(
"Failed to download the profile.",
"\"Network Error\" encountered when trying to download the profile from the server.",
Expand Down

0 comments on commit 79289a1

Please sign in to comment.