Browse Source

Fixes to get the linter peachy

try-cypress
Matthew Aaron Raymer 2 years ago
parent
commit
54d556ac4b
  1. 5
      src/views/NewEditProjectView.vue
  2. 6
      src/views/ProjectViewView.vue

5
src/views/NewEditProjectView.vue

@ -64,6 +64,7 @@ import { accessToken, SimpleSigner } from "@/libs/crypto";
import * as didJwt from "did-jwt"; import * as didJwt from "did-jwt";
import { IIdentifier } from "@veramo/core"; import { IIdentifier } from "@veramo/core";
import { useAppStore } from "@/store/app"; import { useAppStore } from "@/store/app";
import { AxiosError } from "axios";
interface VerifiableCredential { interface VerifiableCredential {
"@context": string; "@context": string;
@ -189,9 +190,9 @@ export default class NewEditProjectView extends Vue {
this this
); );
} }
} catch (error: any) { } catch (error: unknown) {
let userMessage = "There was an error. See logs for more info."; let userMessage = "There was an error. See logs for more info.";
const serverError = error.response?.data?.error; const serverError = error.response?.data?.error as AxiosError;
if (serverError) { if (serverError) {
if (serverError.message) { if (serverError.message) {
userMessage = serverError.message; // This is info for the user. userMessage = serverError.message; // This is info for the user.

6
src/views/ProjectViewView.vue

@ -150,6 +150,7 @@ import { db } from "../db";
import { IIdentifier } from "@veramo/core"; import { IIdentifier } from "@veramo/core";
import { AppString } from "@/constants/app"; import { AppString } from "@/constants/app";
import * as moment from "moment"; import * as moment from "moment";
import { AxiosError } from "axios";
@Options({ @Options({
components: {}, components: {},
@ -208,8 +209,9 @@ export default class ProjectViewView extends Vue {
// actually, axios throws an error so we never get here // actually, axios throws an error so we never get here
this.errorMessage = "That project does not exist."; this.errorMessage = "That project does not exist.";
} }
} catch (error: any) { } catch (error: unknown) {
if (error?.response?.status === 404) { const serverError = error as AxiosError;
if (serverError.response?.status === 404) {
this.errorMessage = "That project does not exist."; this.errorMessage = "That project does not exist.";
} else { } else {
this.errorMessage = this.errorMessage =

Loading…
Cancel
Save