Log error in the console when safe apps list retrieval fails

This commit is contained in:
juampibermani 2021-06-02 10:07:19 -03:00
parent 3c87e196e4
commit dbc55a5df6
3 changed files with 5 additions and 2 deletions

View File

@ -11,6 +11,7 @@ enum ErrorCodes {
_601 = '601: Error fetching balances',
_900 = '900: Error loading Safe App',
_901 = '901: Error processing Safe Apps SDK request',
_902 = '902: Error loading Safe Apps list',
}
export default ErrorCodes

View File

@ -14,7 +14,7 @@ import { SAFELIST_ADDRESS } from 'src/routes/routes'
import { useAppList } from '../hooks/useAppList'
import { SAFE_APP_FETCH_STATUS, SafeApp } from '../types'
import AddAppForm from './AddAppForm'
import { AppData } from 'src/logic/configService/index'
import { AppData } from 'src/logic/configService/'
const Wrapper = styled.div`
height: 100%;

View File

@ -7,6 +7,7 @@ import { getNetworkId } from 'src/config'
import enqueueSnackbar from 'src/logic/notifications/store/actions/enqueueSnackbar'
import { NOTIFICATIONS } from 'src/logic/notifications'
import { useDispatch } from 'react-redux'
import { logError, Errors } from 'src/logic/exceptions/CodedException'
type UseAppListReturnType = {
appList: SafeApp[]
@ -27,7 +28,8 @@ const useAppList = (): UseAppListReturnType => {
try {
const result = await fetchSafeAppsList()
setApiAppsList(result && result?.length ? result : apiAppsList)
} catch (err) {
} catch (e) {
logError(Errors._902, e.message, undefined, false)
dispatch(enqueueSnackbar(NOTIFICATIONS.SAFE_APPS_FETCH_ERROR_MSG))
}
setIsLoading(false)