diff --git a/FrontEnd/src/components/SearchPage/Search.js b/FrontEnd/src/components/SearchPage/Search.js index 438c8fd3d..2194964bb 100644 --- a/FrontEnd/src/components/SearchPage/Search.js +++ b/FrontEnd/src/components/SearchPage/Search.js @@ -29,7 +29,20 @@ export function Search({ isAuthorized }) { const searchUrl = 'search'; const { mutate } = useSWRConfig(); - const fetcher = (url) => axios.get(url).then((res) => res.data); + const fetcher = (url) => + axios + .get(url) + .then((res) => res.data) + .catch(function (error) { + if (error.response) { + console.log(error.response.data); + } else if (error.request) { + console.log(error.request); + } else { + console.log('Error', error.message); + } + console.log(error.config); + }); async function getRequest(url) { const data = await fetcher(url); diff --git a/FrontEnd/src/components/SearchPage/search_field/companies/CompanyCard.js b/FrontEnd/src/components/SearchPage/search_field/companies/CompanyCard.js index 0aaad6809..cc7df3c63 100644 --- a/FrontEnd/src/components/SearchPage/search_field/companies/CompanyCard.js +++ b/FrontEnd/src/components/SearchPage/search_field/companies/CompanyCard.js @@ -48,6 +48,15 @@ const CompanyCard = ({ companyData, isAuthorized }) => { }) .then((response) => { return response.data; + }) + .catch(function (error) { + if (error.response) { + console.log(error.response.data); + } else if (error.request) { + console.log(error.request); + } else { + console.log('Error', error.message); + } }); const NewList = []; for (let item of data.results) {