Skip to content

Commit 6d5d867

Browse files
committedOct 1, 2021
feat: Improve errors management

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed
 

‎packages/cozy-harvest-lib/src/components/infos/TriggerErrorInfo.spec.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ describe('TriggerErrorInfo', () => {
5151
error: new Error('Something is undefined')
5252
}
5353
})
54-
expect(
55-
root.getByText('An unknown error has occurred. (Something is undefined)')
56-
).toBeTruthy()
54+
expect(root.findByText('An unknown error has occurred.')).toBeTruthy()
5755
})
5856
})

‎packages/cozy-harvest-lib/src/helpers/konnectors.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,12 @@ export class KonnectorJobError extends Error {
106106
// but the user will be able to do the 2fa on its mobile phone.
107107
(this.code === 'USER_ACTION_NEEDED' ||
108108
this.code === 'USER_ACTION_NEEDED.SCA_REQUIRED' ||
109-
this.code === 'USER_ACTION_NEEDED.WEBAUTH_REQUIRED')
109+
this.code === 'USER_ACTION_NEEDED.WEBAUTH_REQUIRED' ||
110+
this.code === 'USER_ACTION_NEEDED.OAUTH_OUTDATED' ||
111+
this.code === 'USER_ACTION_NEEDED.CHANGE_PASSWORD' ||
112+
this.code === 'VENDOR_DOWN' ||
113+
this.code === 'VENDOR_DOWN.BANK_DOWN' ||
114+
this.code === 'VENDOR_DOWN.LINXO_DOWN')
110115
)
111116
}
112117
}

‎packages/cozy-harvest-lib/src/locales/en.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,11 @@
141141
},
142142
"TERMS_VERSION_MISMATCH": {
143143
"title": "Latest Terms of Service non accepted",
144-
"description": "%{name} seems to have updated its Terms Of Service. Please check that the service is up to date. It this error still occurs, please contact us at <a href=\"mailto:contact@cozycloud.cc\">contact@cozycloud.cc</a>."
144+
"description": "%{name} seems to have updated its Terms Of Service. Please check that the service is up to date. It this error still occurs, please contact us at [contact@cozycloud.cc](mailto:contact@cozycloud.cc)."
145145
},
146146
"UNKNOWN_ERROR": {
147147
"title": "Connection error",
148-
"description": "An unknown error has occurred."
148+
"description": "An unknown error has occurred. You can try to update your data. If the problem persists, please contact us at [claude@cozycloud.cc](mailto:claude@cozycloud.cc)."
149149
},
150150
"USER_ACTION_NEEDED": {
151151
"title": "Action needed on the provider's website",
@@ -189,7 +189,7 @@
189189
},
190190
"VENDOR_DOWN.BANK_DOWN": {
191191
"title": "Unavailable bank website",
192-
"description": "It seems that the [%{name}](%{link}) website is unavailable at the moment. Please rerun the connector later."
192+
"description": "Access to the [%{name}](%{link}) customer area is currently unavailable. Please rerun the connector later"
193193
},
194194
"VENDOR_DOWN.LINXO_DOWN": {
195195
"title": "Unavailable service",

‎packages/cozy-harvest-lib/src/locales/fr.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,11 @@
141141
},
142142
"TERMS_VERSION_MISMATCH": {
143143
"title": "Nouvelles CGUs à accepter",
144-
"description": "Il semblerait que %{name} ait mis à jour ses Conditions Générales d'Utilisation. Merci de vérifier que le service est à jour. Si l'erreur persiste, contacter nous via <a href=\\\"mailto:contact@cozycloud.cc\\\">contact@cozycloud.cc</a>."
144+
"description": "Il semblerait que %{name} ait mis à jour ses Conditions Générales d'Utilisation. Merci de vérifier que le service est à jour. Si l'erreur persiste, contacter nous via [contact@cozycloud.cc](mailto:contact@cozycloud.cc)."
145145
},
146146
"UNKNOWN_ERROR": {
147147
"title": "Erreur de Connexion",
148-
"description": "Une erreur inconnue est survenue"
148+
"description": "Une erreur inconnue est survenue. Vous pouvez essayer de mettre à jour vos données. Si le problème persiste, n'hésitez pas à nous contacter via [claude@cozycloud.cc](mailto:claude@cozycloud.cc)."
149149
},
150150
"USER_ACTION_NEEDED": {
151151
"title": "Action nécessaire chez le fournisseur",
@@ -189,7 +189,7 @@
189189
},
190190
"VENDOR_DOWN.BANK_DOWN": {
191191
"title": "Site non disponible",
192-
"description": "Site non disponible"
192+
"description": "L'accès à l'espace client de [%{name}](%{link}) est actuellement indisponible, veuillez vous reconnecter plus tard"
193193
},
194194
"VENDOR_DOWN.LINXO_DOWN": {
195195
"title": "Service non disponible",

0 commit comments

Comments
 (0)
Please sign in to comment.