2016-07-26 11:00:54 +00:00
|
|
|
#include "mh/errors.h"
|
2016-07-25 10:51:54 +00:00
|
|
|
|
2016-07-29 17:05:11 +00:00
|
|
|
const char *mh_error_string(int code) {
|
|
|
|
switch (code) {
|
|
|
|
case MH_E_NO_ERROR:
|
|
|
|
return "no error";
|
|
|
|
case MH_E_UNKNOWN_CODE:
|
|
|
|
return "unknown multihash code";
|
|
|
|
case MH_E_TOO_SHORT:
|
2016-08-01 15:33:32 +00:00
|
|
|
return "multihash too short. must be > 2 bytes";
|
2016-07-29 17:05:11 +00:00
|
|
|
case MH_E_TOO_LONG:
|
|
|
|
return "multihash too long. must be < 129 bytes";
|
2016-08-01 15:33:32 +00:00
|
|
|
case MH_E_VARINT_NOT_SUPPORTED:
|
|
|
|
return "c-multihash does not yet support"
|
|
|
|
" varint encoding";
|
2016-08-10 13:46:15 +00:00
|
|
|
case MH_E_DIGSET_TOO_LONG:
|
|
|
|
return "c-multihash does not support digsets"
|
|
|
|
" longer than 127 bytes yet";
|
2016-07-29 17:05:11 +00:00
|
|
|
default:
|
|
|
|
return "unknown error code";
|
2016-07-25 11:06:39 +00:00
|
|
|
}
|
2016-07-25 10:51:54 +00:00
|
|
|
}
|