Improve API to create locations

Improve on top of sehraf work, add documentation for API token params
Deprecate old version and disable it once RS 0.6.6 is released
New method take relevant paramethers explicitely instead of having them
  incapsualted inside a RsLoginHelper::Location struct
New method return a proper error_condition instead of boolean + string
RsLoginHelper::attemptLogin doesn't need manual wrapper anymore
This commit is contained in:
Gioacchino Mazzurco 2020-06-09 20:13:22 +02:00
parent 275bdba132
commit 4a34cfaf11
No known key found for this signature in database
GPG key ID: A1FBCA3872E87051
4 changed files with 194 additions and 22 deletions

View file

@ -29,6 +29,7 @@
#include <cstdint>
#include <system_error>
#include "util/rsdebug.h"
#include "util/rsmemory.h"
class RsJsonApi;
@ -74,8 +75,7 @@ struct RsJsonApiErrorCategory: std::error_category
case RsJsonApiErrorNum::NOT_A_MACHINE_GUN:
return "Method must not be called in burst";
default:
return "Error message for error: " + std::to_string(ev) +
" not available in category: " + name();
return rsErrorNotInCategory(ev, name());
}
}