Skip to content

Commit

Permalink
debug: add location message when printing warning
Browse files Browse the repository at this point in the history
  • Loading branch information
PauloUbirajara committed Apr 30, 2024
1 parent 9c152c2 commit b0ce9a6
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/routes/+error.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
const isLogged = Boolean($page.data.access);
const status = $page.status || "Erro";
const error = $page.error?.message || "Erro ao buscar a página solicitada";
console.warn({ status, error });
</script>

<Navbar {isLogged} />
Expand Down
2 changes: 1 addition & 1 deletion src/routes/app/categories/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const load: PageServerLoad = async (event) => {
categoryResponse,
};
} catch (e) {
console.warn(e);
console.warn("failed when loading categories", e);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/routes/app/categories/[id]/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const actions: Actions = {
try {
await new CategoryRepository({ accessToken }).deleteById({ id });
} catch (e) {
console.warn(e);
console.warn("failed when removing category", e);
return fail(constants.HTTP_STATUS_INTERNAL_SERVER_ERROR, {
error: "Erro ao remover categoria",
});
Expand Down
2 changes: 1 addition & 1 deletion src/routes/app/transactions/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const load: PageServerLoad = async (event) => {
categoryResponse,
};
} catch (e) {
console.warn(e);
console.warn("failed when loading transactions", e);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/routes/app/transactions/[id]/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const actions: Actions = {
try {
await new TransactionRepository({ accessToken }).deleteById({ id });
} catch (e) {
console.warn(e);
console.warn("failed to remove transaction", e);
return fail(constants.HTTP_STATUS_INTERNAL_SERVER_ERROR, {
error: "Erro ao remover transação",
});
Expand Down
2 changes: 1 addition & 1 deletion src/routes/app/wallets/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const load: PageServerLoad = async (event) => {
currencyResponse,
};
} catch (e) {
console.warn(e);
console.warn("loading wallets", e);
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/routes/app/wallets/[id]/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const actions: Actions = {
try {
await new WalletRepository({ accessToken }).deleteById({ id });
} catch (e) {
console.warn(e);
console.warn("failed when removing wallet", e);
return fail(constants.HTTP_STATUS_INTERNAL_SERVER_ERROR, {
error: "Erro ao remover carteira",
});
Expand All @@ -55,7 +55,7 @@ export const actions: Actions = {
const format = data["format"];
return await new WalletRepository({ accessToken }).export({ id, format });
} catch (e) {
console.warn(e);
console.warn("Could not get credentials for export fetch call", e);
return fail(constants.HTTP_STATUS_INTERNAL_SERVER_ERROR, {
error: "Erro ao exportar carteira",
});
Expand Down
2 changes: 1 addition & 1 deletion src/routes/app/wallets/[id]/WalletDetail.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
type: ToastType.SUCCESS,
});
} catch (e) {
console.warn({ e });
console.warn("Could not export", e);
showToast({
title: "Exportar carteira",
message: `Não foi possível abrir resultado da exportação para o formato "${format}"`,
Expand Down
2 changes: 1 addition & 1 deletion src/routes/auth/login/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
formMessages.success = "Login realizado com sucesso.";
}
} catch (e: any) {
console.warn(e);
console.warn("Failed to login", e);
formMessages.errors.detail = "Houve um erro ao tentar realizar login.";
} finally {
loading = false;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/auth/register/RegisterForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
formMessages.success = "Cadastro realizado com sucesso.";
}
} catch (e: any) {
console.warn(e);
console.warn("Failed to register", e);
formMessages.errors.detail = "Houve um erro ao tentar realizar cadastro.";
} finally {
loading = false;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/auth/reset-password/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
const data = await response.json();
formMessages.errors = data.errors;
} catch (e) {
console.warn(e);
console.warn("Failed to send reset password", e);
formMessages.errors.detail = "Erro ao solicitar redefinição de senha.";
} finally {
loading = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@
onResetPasswordSuccess();
}
formMessages.errors = resetPasswordResponse.data.errors;
console.log({ formMessages });
} catch (e) {
console.warn(e);
console.warn("Error when resetting password", e);
formMessages.errors.detail = "Erro ao redefinir senha.";
} finally {
loading = false;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/jwtAuth/backendJwtAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class BackendJWTAuth implements IJWTAuth {
const { detail } = await response.json();

if (!response.ok) {
console.warn(detail);
console.warn("Error when resetting password", detail);
return Promise.reject("Houve um erro ao solicitar redefinição de senha.");
}

Expand Down

0 comments on commit b0ce9a6

Please sign in to comment.