MerginMaps / qgis-plugin

QGIS plugin for managing Mergin Maps projects
GNU General Public License v3.0
34 stars 13 forks source link

Better dialog error when trying to create a project with an already existing name and the projects limit hit error. #601

Closed ValentinBuira closed 3 days ago

ValentinBuira commented 2 months ago

This PR improve the dialog error given to user when trying to create a project and sync project. Instead of giving a dump of the server error we display only the part that matter to the users

So far we handle

This PR also relies on another PR in the mergin python api client (see : MerginMaps/python-api-client/pull/209 )

resolve #599 resolve #561

Before:

Capture d’écran before


Capture d’écran before quota

After: Screenshot from 2024-07-09 15-27-29

Screenshot from 2024-07-09 16-11-00

ValentinBuira commented 2 months ago

For reviewer, I think it works fine by now but as we handle more and more case we will have a lot of duplicate code because the same error can happen in mutiple place : for exemple StorageLimitHit happen both in create_project and sync_project

I advice to make a more general framework to handle error dialog in the futur

alexd0793 commented 3 days ago

Testing all cases, looking good :)