mirror of
https://github.com/p-stream/p-stream.git
synced 2026-03-11 09:45:33 +00:00
clean up error logging
This commit is contained in:
parent
f0dde1e78f
commit
1e949ed530
1 changed files with 13 additions and 3 deletions
|
|
@ -79,7 +79,11 @@ export class TraktService {
|
|||
} catch (error: any) {
|
||||
const msg =
|
||||
error?.data?.message ?? error?.message ?? "Failed to exchange code";
|
||||
console.error("[TraktService] Failed to exchange code:", error);
|
||||
const status = error?.response?.status;
|
||||
console.error(
|
||||
"[TraktService] Failed to exchange code:",
|
||||
status ? `${status} - ${msg}` : msg,
|
||||
);
|
||||
throw new Error(msg);
|
||||
}
|
||||
}
|
||||
|
|
@ -112,8 +116,14 @@ export class TraktService {
|
|||
useTraktAuthStore
|
||||
.getState()
|
||||
.setTokens(data.access_token, data.refresh_token, expiresAt);
|
||||
} catch (error) {
|
||||
console.error("[TraktService] Failed to refresh token:", error);
|
||||
} catch (error: any) {
|
||||
const msg =
|
||||
error?.data?.message ?? error?.message ?? "Failed to refresh token";
|
||||
const status = error?.response?.status;
|
||||
console.error(
|
||||
"[TraktService] Failed to refresh token:",
|
||||
status ? `${status} - ${msg}` : msg,
|
||||
);
|
||||
useTraktAuthStore.getState().clear();
|
||||
throw error;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue