Skip to content

Commit

Permalink
fix unnecessary error checks
Browse files Browse the repository at this point in the history
  • Loading branch information
brnovasco committed Oct 1, 2024
1 parent f3d7dd9 commit 818879d
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions apps/deepsirius-ui/src/server/api/routers/ssh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,6 @@ export const sshRouter = createTRPCRouter({
});
}
const data = await res.text();
if (!res.ok) {
throw new TRPCError({
code: 'INTERNAL_SERVER_ERROR',
message: data.replace(env.STORAGE_API_KEY, '***'),
});
}
return { content: data };
}),
catImage: protectedProcedure
Expand Down Expand Up @@ -211,9 +205,7 @@ export const sshRouter = createTRPCRouter({
message: error.message,
});
}
const buffer = await res.arrayBuffer().catch((err: Error) => {
throw new Error(`Failed to fetch buffer file: ${err.message.replace(env.STORAGE_API_KEY, '***')}`);
});
const buffer = await res.arrayBuffer();
const zip = await JSZip.loadAsync(buffer).catch((err: Error) => {
throw new Error(`Failed to load ZIP file: ${err.message}`);
});
Expand Down

0 comments on commit 818879d

Please sign in to comment.