globe-and-citizen / cnc-portal

The Crypto Native Portal, an app that creates a mechanism to financially acknowledge the micro contributions of Open Source collaborators along with tools that promote effective governance.
3 stars 0 forks source link

Refactor/ Make error more reactive #229

Closed aliassan closed 1 month ago

aliassan commented 1 month ago

Description

Change SIWE composable to get better error handling.

Fixes #214

Type of change

Please delete options that are not relevant.

Checklist:

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 0% with 49 lines in your changes missing coverage. Please review.

Project coverage is 30.25%. Comparing base (6b42442) to head (8d22024). Report is 56 commits behind head on develop.

Files Patch % Lines
app/src/composables/useSiwe.ts 0.00% 31 Missing and 2 partials :warning:
app/src/utils/errorUtil.ts 0.00% 9 Missing and 1 partial :warning:
app/src/adapters/siweMessageCreatorAdapter.ts 0.00% 6 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #229 +/- ## =========================================== + Coverage 28.53% 30.25% +1.71% =========================================== Files 90 78 -12 Lines 1598 1299 -299 Branches 350 294 -56 =========================================== - Hits 456 393 -63 + Misses 977 784 -193 + Partials 165 122 -43 ``` | [Flag](https://app.codecov.io/gh/globe-and-citizen/cnc-portal/pull/229/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=globe-and-citizen) | Coverage Δ | | |---|---|---| | [api-unit-tests](https://app.codecov.io/gh/globe-and-citizen/cnc-portal/pull/229/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=globe-and-citizen) | `?` | | | [app-unit-tests](https://app.codecov.io/gh/globe-and-citizen/cnc-portal/pull/229/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=globe-and-citizen) | `30.25% <0.00%> (+2.59%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=globe-and-citizen#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

aliassan commented 1 month ago

Okay, I may need further clarification there now, maybe an example. In the implementation I have now all the errors are being handled, both the Network and Client errors. I also have an instance where I have a separate error for dev in log and user friendly one for toast, check lines 36 and 37 in siweMessageCreatorAdapter.ts

hermannleboss commented 1 month ago

Okay, I may need further clarification there now, maybe an example. In the implementation I have now all the errors are being handled, both the Network and Client errors. I also have an instance where I have a separate error for dev in log and user friendly one for toast, check lines 36 and 37 in siweMessageCreatorAdapter.ts

OK let say i want this message to popup:

When there is a

That what i want to say when i say more explicit error.