status-desktop/ui
Eric Mastro ee1287b71d fix: prevent crash on generate account wrong password
Fixes #2448.

Currently, if a wrong password is entered when generating a wallet account, the app will crash due to attempting to decode a `GeneratedAccount ` from an rpc response containing only an error.

With this PR, we are detecting if an error is returned in the response, and if so, raising a StatusGoException. This exception is caught in the call chain, and translated in to a `StatusGoError` which is serialised and sent to the QML view, where it is parsed and displayed as an invalid password error in the input box.

refactor: remove string return values as error messages in wallet model
In the wallet model, we were passing back empty strings for no error, or an error as a string. This is not only confusing, but does not benefit from leaning on the compiler and strong types. One has to read the entire code to understand if a string result is returned when there is no error instead of implicitly being able to understand there is no return type.

To alleviate this, account creation fundtions that do not need to return a value have been changed to a void return type, and raise `StatusGoException` if there is an error encountered. This can be caught in the call chain and used as necessary (ie to pass to QML).

refactor: move invalid password string detection to Utils
Currently, we are reading returned view model values and checking to see if they include a known string from Status Go that means there was an invalid password used. This string was placed in the codebased in mulitple locations.

This PR moves the string check to a Utils function and updates all the references to use the function in Utils.
2021-05-14 10:27:37 -04:00
..
StatusQ@eb87aa4bcb chore: add StatusQ as dependency 2021-05-04 14:42:28 -04:00
app fix: prevent crash on generate account wrong password 2021-05-14 10:27:37 -04:00
fonts fix: use normal Inter for normal text and StatusInter for addresses 2020-07-02 10:51:57 -04:00
i18n update translation keys 2021-03-16 12:43:57 -04:00
imports fix: prevent crash on generate account wrong password 2021-05-14 10:27:37 -04:00
onboarding fix: fix lists overflowing 2021-05-03 14:46:25 -04:00
shared fix: prevent crash on generate account wrong password 2021-05-14 10:27:37 -04:00
sounds feat: allow users to turn of notification sounds 2020-10-20 13:50:49 -04:00
generate-rcc.sh chore: add StatusQ as dependency 2021-05-04 14:42:28 -04:00
main.qml fix(Onboarding): show warning screen at the start of no account 2021-05-11 14:44:47 -04:00
nim-status-client.pro feat(Communities): add Back up community rectangle for admins 2021-04-29 13:05:49 -04:00