prefer console.error messages for errors

This commit is contained in:
2023-05-28 07:10:00 -06:00
parent 0ce06bd9ac
commit 32351b07b7
10 changed files with 23 additions and 31 deletions

View File

@@ -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);