Fix a typescript issue with catch variable type
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -210,7 +210,7 @@ export default class Register extends mixins(identityEditionMixin) {
|
||||
await this.$router.push({ name: RouteName.HOME });
|
||||
}
|
||||
}
|
||||
} catch (errorCatched) {
|
||||
} catch (errorCatched: any) {
|
||||
this.errors = errorCatched.graphQLErrors.reduce(
|
||||
(acc: { [key: string]: string }, error: any) => {
|
||||
acc[error.details || error.field] = error.message;
|
||||
|
||||
@@ -133,7 +133,7 @@ export default class CreateDiscussion extends Vue {
|
||||
slug: data.createDiscussion.slug,
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
|
||||
if (error.graphQLErrors[0].field == "title") {
|
||||
|
||||
@@ -174,7 +174,7 @@ export default class CreateGroup extends mixins(IdentityEditionMixin) {
|
||||
displayName: this.group.displayName(),
|
||||
}) as string
|
||||
);
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
this.handleError(err);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -704,7 +704,7 @@ export default class Group extends mixins(GroupMixin) {
|
||||
},
|
||||
],
|
||||
});
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
|
||||
this.$notifier.error(error.graphQLErrors[0].message);
|
||||
}
|
||||
@@ -754,7 +754,7 @@ export default class Group extends mixins(GroupMixin) {
|
||||
this.$notifier.success(
|
||||
this.$t("Group {groupTitle} reported", { groupTitle }) as string
|
||||
);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
this.$notifier.error(
|
||||
this.$t("Error while reporting group {groupTitle}", {
|
||||
|
||||
@@ -246,7 +246,7 @@ export default class GroupFollowers extends mixins(GroupMixin) {
|
||||
username: follower.actor.preferredUsername,
|
||||
});
|
||||
this.$notifier.success(message as string);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
|
||||
this.$notifier.error(error.graphQLErrors[0].message);
|
||||
|
||||
@@ -335,7 +335,7 @@ export default class GroupMembers extends mixins(GroupMixin) {
|
||||
}) as string
|
||||
);
|
||||
this.newMemberUsername = "";
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
|
||||
this.inviteError = error.graphQLErrors[0].message;
|
||||
@@ -402,7 +402,7 @@ export default class GroupMembers extends mixins(GroupMixin) {
|
||||
group: this.group.name || usernameWithDomain(this.group),
|
||||
}) as string
|
||||
);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
|
||||
this.$notifier.error(error.graphQLErrors[0].message);
|
||||
@@ -458,7 +458,7 @@ export default class GroupMembers extends mixins(GroupMixin) {
|
||||
successMessage = "The member role was updated to simple member";
|
||||
}
|
||||
this.$notifier.success(this.$t(successMessage) as string);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
|
||||
this.$notifier.error(error.graphQLErrors[0].message);
|
||||
|
||||
@@ -238,7 +238,7 @@ export default class GroupSettings extends mixins(GroupMixin) {
|
||||
variables,
|
||||
});
|
||||
this.$notifier.success(this.$t("Group settings saved") as string);
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
this.handleError(err);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ export default class MyGroups extends Vue {
|
||||
},
|
||||
],
|
||||
});
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
|
||||
this.$notifier.error(error.graphQLErrors[0].message);
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ export default class EditPost extends mixins(GroupMixin) {
|
||||
params: { slug: data.createPost.slug },
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
this.errors = error.graphQLErrors.reduce(
|
||||
(acc: { [key: string]: any }, localError: any) => {
|
||||
@@ -384,7 +384,7 @@ export default class EditPost extends mixins(GroupMixin) {
|
||||
obj.picture = { mediaId: this.editablePost.picture.id };
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.error(e);
|
||||
}
|
||||
return obj;
|
||||
|
||||
@@ -441,7 +441,7 @@ export default class Resources extends Mixins(ResourceMixin) {
|
||||
this.newResource.title = "";
|
||||
this.newResource.summary = "";
|
||||
this.newResource.resourceUrl = "";
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
console.error(err);
|
||||
this.modalError = err.graphQLErrors[0].message;
|
||||
}
|
||||
@@ -461,7 +461,7 @@ export default class Resources extends Mixins(ResourceMixin) {
|
||||
this.newResource.summary = data.previewResourceLink.description;
|
||||
this.newResource.metadata = data.previewResourceLink;
|
||||
this.newResource.type = "link";
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
console.error(err);
|
||||
this.modalError = err.graphQLErrors[0].message;
|
||||
}
|
||||
@@ -568,7 +568,7 @@ export default class Resources extends Mixins(ResourceMixin) {
|
||||
(id) => id !== resourceID
|
||||
);
|
||||
delete this.checkedResources[resourceID];
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
@@ -705,7 +705,7 @@ export default class Resources extends Mixins(ResourceMixin) {
|
||||
console.log("Finished adding resource to new parent");
|
||||
},
|
||||
});
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
@@ -740,7 +740,7 @@ export default class Resources extends Mixins(ResourceMixin) {
|
||||
params: { path },
|
||||
query: { ...this.$route.query, ...args },
|
||||
});
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
if (isNavigationFailure(e, NavigationFailureType.redirected)) {
|
||||
throw Error(e.toString());
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ export default class AccountSettings extends Vue {
|
||||
);
|
||||
this.newEmail = "";
|
||||
this.passwordForEmailChange = "";
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
this.handleErrors("email", err);
|
||||
}
|
||||
}
|
||||
@@ -325,7 +325,7 @@ export default class AccountSettings extends Vue {
|
||||
this.$notifier.success(
|
||||
this.$t("The password was successfully changed") as string
|
||||
);
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
this.handleErrors("password", err);
|
||||
}
|
||||
}
|
||||
@@ -359,7 +359,7 @@ export default class AccountSettings extends Vue {
|
||||
});
|
||||
|
||||
return await this.$router.push({ name: RouteName.HOME });
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
this.deletePasswordErrors = err.graphQLErrors.map(
|
||||
({ message }: GraphQLError) => message
|
||||
);
|
||||
|
||||
@@ -233,7 +233,7 @@ export default class Login extends Vue {
|
||||
}
|
||||
this.$router.push({ name: RouteName.HOME });
|
||||
return;
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
this.submitted = false;
|
||||
if (err.graphQLErrors) {
|
||||
err.graphQLErrors.forEach(({ message }: { message: string }) => {
|
||||
@@ -257,7 +257,7 @@ export default class Login extends Vue {
|
||||
});
|
||||
try {
|
||||
await initializeCurrentActor(this.$apollo.provider.defaultClient);
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
if (err instanceof NoIdentitiesException) {
|
||||
await this.$router.push({
|
||||
name: RouteName.REGISTER_PROFILE,
|
||||
|
||||
@@ -95,7 +95,7 @@ export default class PasswordReset extends Vue {
|
||||
saveUserData(data.resetPassword);
|
||||
this.$router.push({ name: RouteName.HOME });
|
||||
return;
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
err.graphQLErrors.forEach(({ message }: { message: any }) => {
|
||||
this.errors.push(message);
|
||||
});
|
||||
|
||||
@@ -256,7 +256,7 @@ export default class Register extends Vue {
|
||||
name: RouteName.REGISTER_PROFILE,
|
||||
params: { email: this.credentials.email },
|
||||
});
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
this.errors = error.graphQLErrors.reduce(
|
||||
(acc: string[], localError: any) => {
|
||||
|
||||
@@ -117,13 +117,15 @@ export default class SendPasswordReset extends Vue {
|
||||
});
|
||||
|
||||
this.validationSent = true;
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
console.error(err);
|
||||
err.graphQLErrors.forEach(({ message }: { message: string }) => {
|
||||
if (this.errors.indexOf(message) < 0) {
|
||||
this.errors.push(message);
|
||||
}
|
||||
});
|
||||
if (err.graphQLErrors) {
|
||||
err.graphQLErrors.forEach(({ message }: { message: string }) => {
|
||||
if (this.errors.indexOf(message) < 0) {
|
||||
this.errors.push(message);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user