Improving Error Handling
: Missing PARTIAL_FILE and long switch-case
refactoring
#1140
Labels
Improving Error Handling
: Missing PARTIAL_FILE and long switch-case
refactoring
#1140
Description
While taking a look at
error.h
, I noticed that theErrorCode
enum entryPARTIAL_FILE
is not used in theerror.cpp
switch statement. Is this intended?I also wanted to ask if there was any specific reason for including
CURLE_OBSOLETE46
while not adding the other obsolete cURL error codes? Are the others related to unsupported protocols?PARTIAL_FILE
andCURLE_OBSOLETE46
were both added in this commit when adding better cpr error codes in september.Additionally
error.cpp
looks kind of scarry with its 200-lineswitch-case
statement. I was wondering if using anunordered_map
instead of theswitch-case
statement might make the code a bit more readable and easier to maintain.For example:
Example/How to Reproduce
Files to take a look at:
error.cpp
anderror.h
as well as this commitPossible Fix
PARTIAL_FILE
-case toerror.cpp
errror.cpp
to use map instead of aswitch-case
Where did you get it from?
GitHub (branch e.g. master)
Additional Context/Your Environment
The text was updated successfully, but these errors were encountered: