Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Sadzurami committed Oct 17, 2024
1 parent c17e397 commit 78dccb3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,12 @@ export async function readProxies(file: string): Promise<string[]> {
}

export async function saveSession(directory: string, session: Session) {
const file = path.resolve(directory, `${session.Username}.steamsession`);
await fs.writeFile(file, JSON.stringify(session, null, 2));
try {
const file = path.resolve(directory, `${session.Username}.steamsession`);
await fs.writeFile(file, JSON.stringify(session, null, 2));
} catch (error) {
throw new Error('Failed to save session', { cause: error });
}
}

export function decodeRefreshToken(token: string) {
Expand Down

0 comments on commit 78dccb3

Please sign in to comment.