diff --git a/src/services/PerudoApi.ts b/src/services/PerudoApi.ts index c8737be..dd1297a 100644 --- a/src/services/PerudoApi.ts +++ b/src/services/PerudoApi.ts @@ -41,8 +41,11 @@ export default class PerudoApi { }); } - private get(url: string, getParameters?: Record) { + private get(url: string, getParameters?: Record): AxiosPromise { return axios.get(url).then((response: AxiosResponse) => { + if (response?.data?.errors?.length > 0) { + throw response.data.errors?.join(); + } return response; }) } diff --git a/src/views/Home.vue b/src/views/Home.vue index 5effb35..f6d7c72 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -1,5 +1,9 @@