Loading src/api.cpp +15 −0 Changes for src/api.cpp: 15 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -727,6 +727,7 @@ public: jresponse = json_object_new_array(); try { const ClientConnections* curcon = nullptr; // Try to reuse existing client session; otherwise perform client login Loading Loading @@ -759,6 +760,20 @@ public: UserInfo(jrequest, jresponse); remSession(jrequest, jresponse); } } catch (const AuthBackendError &e) { // Clear any partial response and return error as JSON json_object_put(jresponse); jresponse = json_object_new_array(); json_object *eobj = json_object_new_object(); json_object_object_add(eobj, "error", json_object_new_string(e.what())); json_object_array_add(jresponse, eobj); } catch (const std::exception &e) { json_object_put(jresponse); jresponse = json_object_new_array(); json_object *eobj = json_object_new_object(); json_object_object_add(eobj, "error", json_object_new_string(e.what())); json_object_array_add(jresponse, eobj); } size_t outsize = 0; const char* out = json_object_to_json_string_length(jresponse, 0, &outsize); Loading Loading
src/api.cpp +15 −0 Changes for src/api.cpp: 15 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -727,6 +727,7 @@ public: jresponse = json_object_new_array(); try { const ClientConnections* curcon = nullptr; // Try to reuse existing client session; otherwise perform client login Loading Loading @@ -759,6 +760,20 @@ public: UserInfo(jrequest, jresponse); remSession(jrequest, jresponse); } } catch (const AuthBackendError &e) { // Clear any partial response and return error as JSON json_object_put(jresponse); jresponse = json_object_new_array(); json_object *eobj = json_object_new_object(); json_object_object_add(eobj, "error", json_object_new_string(e.what())); json_object_array_add(jresponse, eobj); } catch (const std::exception &e) { json_object_put(jresponse); jresponse = json_object_new_array(); json_object *eobj = json_object_new_object(); json_object_object_add(eobj, "error", json_object_new_string(e.what())); json_object_array_add(jresponse, eobj); } size_t outsize = 0; const char* out = json_object_to_json_string_length(jresponse, 0, &outsize); Loading