Log error in the console when safe apps list retrieval fails
This commit is contained in:
parent
3c87e196e4
commit
dbc55a5df6
|
@ -11,6 +11,7 @@ enum ErrorCodes {
|
||||||
_601 = '601: Error fetching balances',
|
_601 = '601: Error fetching balances',
|
||||||
_900 = '900: Error loading Safe App',
|
_900 = '900: Error loading Safe App',
|
||||||
_901 = '901: Error processing Safe Apps SDK request',
|
_901 = '901: Error processing Safe Apps SDK request',
|
||||||
|
_902 = '902: Error loading Safe Apps list',
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ErrorCodes
|
export default ErrorCodes
|
||||||
|
|
|
@ -14,7 +14,7 @@ import { SAFELIST_ADDRESS } from 'src/routes/routes'
|
||||||
import { useAppList } from '../hooks/useAppList'
|
import { useAppList } from '../hooks/useAppList'
|
||||||
import { SAFE_APP_FETCH_STATUS, SafeApp } from '../types'
|
import { SAFE_APP_FETCH_STATUS, SafeApp } from '../types'
|
||||||
import AddAppForm from './AddAppForm'
|
import AddAppForm from './AddAppForm'
|
||||||
import { AppData } from 'src/logic/configService/index'
|
import { AppData } from 'src/logic/configService/'
|
||||||
|
|
||||||
const Wrapper = styled.div`
|
const Wrapper = styled.div`
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
|
@ -7,6 +7,7 @@ import { getNetworkId } from 'src/config'
|
||||||
import enqueueSnackbar from 'src/logic/notifications/store/actions/enqueueSnackbar'
|
import enqueueSnackbar from 'src/logic/notifications/store/actions/enqueueSnackbar'
|
||||||
import { NOTIFICATIONS } from 'src/logic/notifications'
|
import { NOTIFICATIONS } from 'src/logic/notifications'
|
||||||
import { useDispatch } from 'react-redux'
|
import { useDispatch } from 'react-redux'
|
||||||
|
import { logError, Errors } from 'src/logic/exceptions/CodedException'
|
||||||
|
|
||||||
type UseAppListReturnType = {
|
type UseAppListReturnType = {
|
||||||
appList: SafeApp[]
|
appList: SafeApp[]
|
||||||
|
@ -27,7 +28,8 @@ const useAppList = (): UseAppListReturnType => {
|
||||||
try {
|
try {
|
||||||
const result = await fetchSafeAppsList()
|
const result = await fetchSafeAppsList()
|
||||||
setApiAppsList(result && result?.length ? result : apiAppsList)
|
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))
|
dispatch(enqueueSnackbar(NOTIFICATIONS.SAFE_APPS_FETCH_ERROR_MSG))
|
||||||
}
|
}
|
||||||
setIsLoading(false)
|
setIsLoading(false)
|
||||||
|
|
Loading…
Reference in New Issue