Catch backend error and send controlled form error (#2324)

This commit is contained in:
Daniel Sanchez 2021-05-25 10:41:31 +02:00 committed by GitHub
parent 3e4c9cf7d3
commit 9119550373
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -54,8 +54,8 @@ export const safeFieldsValidation = async (values): Promise<Record<string, strin
return errors
}
// if getSafeInfo does not provide data, it's not a valid safe.
const safeInfo = await getSafeInfo(address)
// If getSafeInfo does not provide data, it's not a valid safe.
const safeInfo = await getSafeInfo(address).catch(() => null)
if (!safeInfo) {
errors[FIELD_LOAD_ADDRESS] = SAFE_ADDRESS_NOT_VALID
}