Replace all String
-based error messages with structured error types
#37
Labels
String
-based error messages with structured error types
#37
Generally speaking,
elf-edit
adheres to the convention of using structured data types to represent its error messages, such as with theDynamicError
data type. Unfortunately, there are still some parts ofelf-edit
that use rawString
s to represent errors:elf-edit/src/Data/ElfEdit/Dynamic.hs
Lines 324 to 329 in 40ffaac
elf-edit/src/Data/ElfEdit/Dynamic.hs
Lines 632 to 633 in 40ffaac
elf-edit/src/Data/ElfEdit/HighLevel/GOT.hs
Lines 55 to 58 in fb4699a
elf-edit/src/Data/ElfEdit/HighLevel/Get.hs
Lines 96 to 101 in fb4699a
elf-edit/src/Data/ElfEdit/Relocations/Common.hs
Lines 213 to 218 in fb4699a
elf-edit/src/Data/ElfEdit/Relocations/Common.hs
Lines 247 to 252 in fb4699a
We should replace these uses of
Either String
withEither <structured error type>
, where the specific structured error type is specific to the function in question. We might be able to use existing error types for some functions; for instance,dynNeeded
could likely useEither DynamicError
, just like other functions inData.ElfEdit.Dynamic
do.I don't have a pressing need to fix this right now, especially since fixing this would require API changes. This does seem like a goal that we should work towards in the long term, however.
The text was updated successfully, but these errors were encountered: