More fixes due to typing in catch

This commit is contained in:
Matthew Aaron Raymer
2023-02-02 17:51:03 +08:00
parent 54d556ac4b
commit 99c38079b3
2 changed files with 43 additions and 2 deletions

View File

@@ -190,9 +190,9 @@ export default class NewEditProjectView extends Vue {
this
);
}
} catch (error: unknown) {
} catch (error) {
let userMessage = "There was an error. See logs for more info.";
const serverError = error.response?.data?.error as AxiosError;
const serverError = error as AxiosError;
if (serverError) {
if (serverError.message) {
userMessage = serverError.message; // This is info for the user.