Unify common error category message into a function

This commit is contained in:
Gioacchino Mazzurco 2020-06-09 20:08:23 +02:00
parent 4f0e18cbfd
commit 275bdba132
No known key found for this signature in database
GPG key ID: A1FBCA3872E87051
4 changed files with 14 additions and 5 deletions

View file

@ -33,6 +33,7 @@
#include "serialiser/rsserializable.h"
#include "serialiser/rstypeserializer.h"
#include "util/rstime.h"
#include "util/rsdebug.h"
class RsEvents;
@ -126,8 +127,7 @@ struct RsEventsErrorCategory: std::error_category
case RsEventsErrorNum::INVALID_HANDLER_ID:
return "Invalid handler id";
default:
return "Error message for error: " + std::to_string(ev) +
" not available in category: " + name();
return rsErrorNotInCategory(ev, name());
}
}

View file

@ -37,6 +37,7 @@
#include "util/rstime.h"
#include "retroshare/rsevents.h"
#include "util/rsmemory.h"
#include "util/rsdebug.h"
class RsFiles;
@ -63,8 +64,7 @@ struct RsFilesErrorCategory: std::error_category
case RsFilesErrorNum::FILES_HANDLE_NOT_FOUND:
return "Files handle not found";
default:
return "Error message for error: " + std::to_string(ev) +
" not available in category: " + name();
return rsErrorNotInCategory(ev, name());
}
}