2
0

Render error messages as strings instead of internal codes.

This commit is contained in:
Maarten Billemont
2017-08-01 17:35:13 -04:00
parent b00ad53e42
commit 03080b9ccd
8 changed files with 55 additions and 27 deletions

View File

@@ -662,3 +662,24 @@ MPMarshalledUser *mpw_marshall_read(
*error = MPMarshallErrorFormat;
return NULL;
}
const char *mpw_explainMarshallError(const MPMarshallError error) {
switch (error) {
case MPMarshallSuccess:
return "The marshalling operation completed successfully.";
case MPMarshallErrorStructure:
return "An error in the structure of the marshall file interrupted marshalling.";
case MPMarshallErrorFormat:
return "The marshall file uses an unsupported format version.";
case MPMarshallErrorMissing:
return "A required value is missing or not specified.";
case MPMarshallErrorMasterPassword:
return "The given master password is not valid.";
case MPMarshallErrorIllegal:
return "An illegal value was specified.";
case MPMarshallErrorInternal:
return "An internal system error interrupted marshalling.";
}
return "An unrecognized error occurred.";
}