forked from jsnbuchanan/crowd-funder-for-time-pwa
prefer console.error messages for errors
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
- replace user-affecting console.log & console.error with error messages (eg. catches)
|
||||
|
||||
- stats v1 :
|
||||
- use all bits of randomness for location
|
||||
- 01 show numeric stats
|
||||
- 01 link to world for specific stats
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import * as THREE from "three";
|
||||
import { GLTFLoader } from "three/addons/loaders/GLTFLoader";
|
||||
import * as SkeletonUtils from "three/addons/utils/SkeletonUtils";
|
||||
import * as TWEEN from "@tweenjs/tween.js";
|
||||
import { AppString } from "@/constants/app";
|
||||
import { accountsDB, db } from "@/db";
|
||||
import { MASTER_SETTINGS_KEY } from "@/db/tables/settings";
|
||||
import { accessToken } from "@/libs/crypto";
|
||||
@@ -118,7 +117,7 @@ export async function loadLandmarks(vue, world, scene, loop) {
|
||||
world.lights = [...world.lights, light];
|
||||
}
|
||||
} else {
|
||||
console.log(
|
||||
console.error(
|
||||
"Got bad server response status & data of",
|
||||
resp.status,
|
||||
resp.data
|
||||
@@ -129,7 +128,7 @@ export async function loadLandmarks(vue, world, scene, loop) {
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log("Got exception contacting server:", error);
|
||||
console.error("Got exception contacting server:", error);
|
||||
vue.setAlert(
|
||||
"Error With Server",
|
||||
"There was a problem retrieving your claims from the server."
|
||||
|
||||
@@ -437,7 +437,7 @@ export default class AccountViewView extends Vue {
|
||||
} catch (err) {
|
||||
this.alertMessage =
|
||||
"Clear your cache and start over (after data backup). See console log for more info.";
|
||||
console.log("Telling user to clear cache because:", err);
|
||||
console.error("Telling user to clear cache because:", err);
|
||||
this.alertTitle = "Error Creating Account";
|
||||
this.isAlertVisible = true;
|
||||
}
|
||||
@@ -452,7 +452,7 @@ export default class AccountViewView extends Vue {
|
||||
} catch (err) {
|
||||
this.alertMessage =
|
||||
"Clear your cache and start over (after data backup). See console log for more info.";
|
||||
console.log("Telling user to clear cache because:", err);
|
||||
console.error("Telling user to clear cache because:", err);
|
||||
this.alertTitle = "Error Creating Account";
|
||||
this.isAlertVisible = true;
|
||||
}
|
||||
@@ -503,7 +503,7 @@ export default class AccountViewView extends Vue {
|
||||
const serverError = error as AxiosError;
|
||||
|
||||
this.alertTitle = "Error from Server";
|
||||
console.log("Bad response retrieving limits: ", serverError);
|
||||
console.error("Bad response retrieving limits: ", serverError);
|
||||
// Anybody know how to access items inside "response.data" without this?
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const data: any = serverError.response?.data;
|
||||
|
||||
@@ -189,7 +189,7 @@ export default class ContactsView extends Vue {
|
||||
if (resp.status === 200) {
|
||||
result = resp.data.data;
|
||||
} else {
|
||||
console.log(
|
||||
console.error(
|
||||
"Got bad response status & data of",
|
||||
resp.status,
|
||||
resp.data
|
||||
@@ -215,7 +215,7 @@ export default class ContactsView extends Vue {
|
||||
if (resp2.status === 200) {
|
||||
result = R.concat(result, resp2.data.data);
|
||||
} else {
|
||||
console.log(
|
||||
console.error(
|
||||
"Got bad response status & data of",
|
||||
resp2.status,
|
||||
resp2.data
|
||||
|
||||
@@ -362,7 +362,7 @@ export default class ContactsView extends Vue {
|
||||
this.givenByMeConfirmed = contactConfirmed;
|
||||
this.givenByMeUnconfirmed = contactUnconfirmed;
|
||||
} else {
|
||||
console.log(
|
||||
console.error(
|
||||
"Got bad response status & data of",
|
||||
resp.status,
|
||||
resp.data
|
||||
@@ -416,7 +416,7 @@ export default class ContactsView extends Vue {
|
||||
this.givenToMeConfirmed = contactConfirmed;
|
||||
this.givenToMeUnconfirmed = contactUnconfirmed;
|
||||
} else {
|
||||
console.log(
|
||||
console.error(
|
||||
"Got bad response status & data of",
|
||||
resp.status,
|
||||
resp.data
|
||||
@@ -583,7 +583,7 @@ export default class ContactsView extends Vue {
|
||||
db.contacts.update(contact.did, { seesMe: visibility });
|
||||
} else {
|
||||
this.alertTitle = "Error With Server";
|
||||
console.log("Bad response setting visibility: ", resp.data);
|
||||
console.error("Bad response setting visibility: ", resp.data);
|
||||
if (resp.data.error?.message) {
|
||||
this.alertMessage = resp.data.error?.message;
|
||||
} else {
|
||||
|
||||
@@ -93,8 +93,7 @@ export default class ImportAccountView extends Vue {
|
||||
});
|
||||
this.$router.push({ name: "account" });
|
||||
} catch (err) {
|
||||
console.log("Error!");
|
||||
console.log(err);
|
||||
console.error("Error saving mnemonic & updating settings:", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ export default class NewEditProjectView extends Vue {
|
||||
await accountsDB.open();
|
||||
const num_accounts = await accountsDB.accounts.count();
|
||||
if (num_accounts === 0) {
|
||||
console.log("Problem! Should have a profile!");
|
||||
console.error("Problem! Should have a profile!");
|
||||
} else {
|
||||
const accounts = await accountsDB.accounts.toArray();
|
||||
const account = R.find((acc) => acc.did === this.activeDid, accounts);
|
||||
@@ -145,14 +145,13 @@ export default class NewEditProjectView extends Vue {
|
||||
|
||||
try {
|
||||
const resp = await this.axios.get(url, { headers });
|
||||
console.log(resp.status, resp.data);
|
||||
if (resp.status === 200) {
|
||||
const claim = resp.data.claim;
|
||||
this.projectName = claim.name;
|
||||
this.description = claim.description;
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
console.error("Got error retrieving that project", error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,7 +199,6 @@ export default class NewEditProjectView extends Vue {
|
||||
|
||||
try {
|
||||
const resp = await this.axios.post(url, payload, { headers });
|
||||
console.log("Got resp data:", resp.data);
|
||||
// handleId is new in server v release-1.6.0; remove fullIri when that
|
||||
// version shows up here: https://endorser.ch:3000/api-docs/
|
||||
if (resp.data?.success?.handleId || resp.data?.success?.fullIri) {
|
||||
@@ -217,7 +215,6 @@ export default class NewEditProjectView extends Vue {
|
||||
const route = {
|
||||
name: "project",
|
||||
};
|
||||
console.log(route);
|
||||
that.$router.push(route);
|
||||
},
|
||||
2000,
|
||||
@@ -238,7 +235,10 @@ export default class NewEditProjectView extends Vue {
|
||||
this.alertMessage = JSON.stringify(serverError.toJSON());
|
||||
}
|
||||
} else {
|
||||
console.log("Here's the full error trying to save the claim:", error);
|
||||
console.error(
|
||||
"Here's the full error trying to save the claim:",
|
||||
error
|
||||
);
|
||||
this.alertTitle = "Claim Error";
|
||||
this.alertMessage = error as string;
|
||||
}
|
||||
@@ -254,7 +254,7 @@ export default class NewEditProjectView extends Vue {
|
||||
await accountsDB.open();
|
||||
const num_accounts = await accountsDB.accounts.count();
|
||||
if (num_accounts === 0) {
|
||||
console.log("Problem! Should have a profile!");
|
||||
console.error("Problem! Should have a profile!");
|
||||
} else {
|
||||
const accounts = await accountsDB.accounts.toArray();
|
||||
const account = R.find((acc) => acc.did === this.activeDid, accounts);
|
||||
|
||||
@@ -175,7 +175,6 @@ export default class ProjectViewView extends Vue {
|
||||
const route = {
|
||||
name: "new-edit-project",
|
||||
};
|
||||
console.log(route);
|
||||
this.$router.push(route);
|
||||
}
|
||||
|
||||
@@ -200,7 +199,6 @@ export default class ProjectViewView extends Vue {
|
||||
|
||||
try {
|
||||
const resp = await this.axios.get(url, { headers });
|
||||
console.log("resp.status, resp.data", resp.status, resp.data);
|
||||
if (resp.status === 200) {
|
||||
const startTime = resp.data.startTime;
|
||||
if (startTime != null) {
|
||||
@@ -223,7 +221,7 @@ export default class ProjectViewView extends Vue {
|
||||
this.errorMessage =
|
||||
"Something went wrong retrieving that project." +
|
||||
" See logs for more info.";
|
||||
console.log("Error retrieving project:", error);
|
||||
console.error("Error retrieving project:", error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -238,7 +236,7 @@ export default class ProjectViewView extends Vue {
|
||||
await accountsDB.open();
|
||||
const num_accounts = await accountsDB.accounts.count();
|
||||
if (num_accounts === 0) {
|
||||
console.log("Problem! Should have a profile!");
|
||||
console.error("Problem! Should have a profile!");
|
||||
} else {
|
||||
const accounts = await accountsDB.accounts.toArray();
|
||||
const account = R.find((acc) => acc.did === activeDid, accounts);
|
||||
|
||||
@@ -117,12 +117,10 @@ export default class ProjectsView extends Vue {
|
||||
projects: { handleId: string; name: string; description: string }[] = [];
|
||||
|
||||
onClickLoadProject(id: string) {
|
||||
console.log("projectId", id);
|
||||
localStorage.setItem("projectId", id);
|
||||
const route = {
|
||||
name: "project",
|
||||
};
|
||||
console.log(route);
|
||||
this.$router.push(route);
|
||||
}
|
||||
|
||||
@@ -151,7 +149,7 @@ export default class ProjectsView extends Vue {
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
console.error("Got error loading projects: ", error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,7 +163,7 @@ export default class ProjectsView extends Vue {
|
||||
await accountsDB.open();
|
||||
const num_accounts = await accountsDB.accounts.count();
|
||||
if (num_accounts === 0) {
|
||||
console.log("Problem! Should have a profile!");
|
||||
console.error("Problem! Should have a profile!");
|
||||
} else {
|
||||
const accounts = await accountsDB.accounts.toArray();
|
||||
const account = R.find((acc) => acc.did === activeDid, accounts);
|
||||
@@ -179,7 +177,6 @@ export default class ProjectsView extends Vue {
|
||||
const route = {
|
||||
name: "new-edit-project",
|
||||
};
|
||||
console.log(route);
|
||||
this.$router.push(route);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ export default class SeedBackupView extends Vue {
|
||||
const accounts = await accountsDB.accounts.toArray();
|
||||
this.activeAccount = R.find((acc) => acc.did === activeDid, accounts);
|
||||
} catch (err) {
|
||||
console.log("Got an error loading an identity:", err);
|
||||
console.error("Got an error loading an identity:", err);
|
||||
this.alertTitle = "Error Loading Account";
|
||||
this.alertMessage = "Got an error loading your seed data.";
|
||||
this.isAlertVisible = true;
|
||||
|
||||
Reference in New Issue
Block a user