cecilianor / Qt-thesis

MIT License
9 stars 4 forks source link

Update GetURL code to handle errors using a pair <data, ErrorType> #39

Closed cecilianor closed 8 months ago

cecilianor commented 8 months ago

Implement an ErrorType enum to handle errors that may arise when getting requests from the MapTiler API or parsing the corresponding data.

Basic structure of the type:

enum class ErrorCode {
        success = 0,
        mapTilerError = 1,
        parseError = 2,
        unknownError = 3,
    };

Many of the functions can return a pair where one part of the par will then be the error. Make it a convention to have each pair follow the structure pair <T, ErrorCode> for the sake of consistency.

Then, implement the error handling for all of the functions that get links or tiles and check that it works.