Browse Source

COM-91: Use engine method to display error string

COM-121
Thomas 3 years ago
parent
commit
77da172e78
3 changed files with 3 additions and 92 deletions
  1. +3
    -2
      CpEpEngine.cpp
  2. +0
    -89
      pEp_utility.cpp
  3. +0
    -1
      pEp_utility.h

+ 3
- 2
CpEpEngine.cpp View File

@ -5,6 +5,7 @@
#include <mutex>
#include "GateKeeper.h"
#include "..\libpEpAdapter\Adapter.hh"
#include "pEp\status_to_string.h"
using namespace std;
using namespace pEp::utility;
@ -1029,8 +1030,8 @@ HRESULT CpEpEngine::error(_bstr_t msg, PEP_STATUS status)
std::stringstream stream;
stream << msg;
stream << ": ";
stream << std::hex << status;
stream << " (" << statusToString(status) << ")";
stream << pEp_status_to_string(status);
stream << std::hex << " (" << status << ")";
error(stream.str().c_str());


+ 0
- 89
pEp_utility.cpp View File

@ -591,94 +591,5 @@ namespace pEp {
*opt_field_array = NULL;
}
}
string statusToString(PEP_STATUS status)
{
switch (status)
{
case PEP_STATUS_OK: return "PEP_STATUS_OK";
case PEP_INIT_CANNOT_LOAD_GPGME: return "PEP_INIT_CANNOT_LOAD_GPGME";
case PEP_INIT_GPGME_INIT_FAILED: return "PEP_INIT_GPGME_INIT_FAILED";
case PEP_INIT_NO_GPG_HOME: return "PEP_INIT_NO_GPG_HOME";
case PEP_INIT_NETPGP_INIT_FAILED: return "PEP_INIT_NETPGP_INIT_FAILED";
case PEP_INIT_CANNOT_DETERMINE_GPG_VERSION: return "PEP_INIT_CANNOT_DETERMINE_GPG_VERSION";
case PEP_INIT_UNSUPPORTED_GPG_VERSION: return "PEP_INIT_UNSUPPORTED_GPG_VERSION";
case PEP_INIT_CANNOT_CONFIG_GPG_AGENT: return "PEP_INIT_CANNOT_CONFIG_GPG_AGENT";
case PEP_INIT_SQLITE3_WITHOUT_MUTEX: return "PEP_INIT_SQLITE3_WITHOUT_MUTEX";
case PEP_INIT_CANNOT_OPEN_DB: return "PEP_INIT_CANNOT_OPEN_DB";
case PEP_INIT_CANNOT_OPEN_SYSTEM_DB: return "PEP_INIT_CANNOT_OPEN_SYSTEM_DB";
case PEP_UNKNOWN_DB_ERROR: return "PEP_UNKNOWN_DB_ERROR";
case PEP_KEY_NOT_FOUND: return "PEP_KEY_NOT_FOUND";
case PEP_KEY_HAS_AMBIG_NAME: return "PEP_KEY_HAS_AMBIG_NAME";
case PEP_GET_KEY_FAILED: return "PEP_GET_KEY_FAILED";
case PEP_CANNOT_EXPORT_KEY: return "PEP_CANNOT_EXPORT_KEY";
case PEP_CANNOT_EDIT_KEY: return "PEP_CANNOT_EDIT_KEY";
case PEP_KEY_UNSUITABLE: return "PEP_KEY_UNSUITABLE";
case PEP_MALFORMED_KEY_RESET_MSG: return "PEP_MALFORMED_KEY_RESET_MSG";
case PEP_KEY_NOT_RESET: return "PEP_KEY_NOT_RESET";
case PEP_CANNOT_DELETE_KEY: return "PEP_CANNOT_DELETE_KEY";
case PEP_KEY_IMPORTED: return "PEP_KEY_IMPORTED";
case PEP_NO_KEY_IMPORTED: return "PEP_NO_KEY_IMPORTED";
case PEP_KEY_IMPORT_STATUS_UNKNOWN: return "PEP_KEY_IMPORT_STATUS_UNKNOWN";
case PEP_CANNOT_FIND_IDENTITY: return "PEP_CANNOT_FIND_IDENTITY";
case PEP_CANNOT_SET_PERSON: return "PEP_CANNOT_SET_PERSON";
case PEP_CANNOT_SET_PGP_KEYPAIR: return "PEP_CANNOT_SET_PGP_KEYPAIR";
case PEP_CANNOT_SET_IDENTITY: return "PEP_CANNOT_SET_IDENTITY";
case PEP_CANNOT_SET_TRUST: return "PEP_CANNOT_SET_TRUST";
case PEP_KEY_BLACKLISTED: return "PEP_KEY_BLACKLISTED";
case PEP_CANNOT_FIND_PERSON: return "PEP_CANNOT_FIND_PERSON";
case PEP_CANNOT_FIND_ALIAS: return "PEP_CANNOT_FIND_ALIAS";
case PEP_CANNOT_SET_ALIAS: return "PEP_CANNOT_SET_ALIAS";
case PEP_UNENCRYPTED: return "PEP_UNENCRYPTED";
case PEP_VERIFIED: return "PEP_VERIFIED";
case PEP_DECRYPTED: return "PEP_DECRYPTED";
case PEP_DECRYPTED_AND_VERIFIED: return "PEP_DECRYPTED_AND_VERIFIED";
case PEP_DECRYPT_WRONG_FORMAT: return "PEP_DECRYPT_WRONG_FORMAT";
case PEP_DECRYPT_NO_KEY: return "PEP_DECRYPT_NO_KEY";
case PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH: return "PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH";
case PEP_VERIFY_NO_KEY: return "PEP_VERIFY_NO_KEY";
case PEP_VERIFIED_AND_TRUSTED: return "PEP_VERIFIED_AND_TRUSTED";
case PEP_CANNOT_REENCRYPT: return "PEP_CANNOT_REENCRYPT";
case PEP_CANNOT_DECRYPT_UNKNOWN: return "PEP_CANNOT_DECRYPT_UNKNOWN";
case PEP_TRUSTWORD_NOT_FOUND: return "PEP_TRUSTWORD_NOT_FOUND";
case PEP_TRUSTWORDS_FPR_WRONG_LENGTH: return "PEP_TRUSTWORDS_FPR_WRONG_LENGTH";
case PEP_TRUSTWORDS_DUPLICATE_FPR: return "PEP_TRUSTWORDS_DUPLICATE_FPR";
case PEP_CANNOT_CREATE_KEY: return "PEP_CANNOT_CREATE_KEY";
case PEP_CANNOT_SEND_KEY: return "PEP_CANNOT_SEND_KEY";
case PEP_PHRASE_NOT_FOUND: return "PEP_PHRASE_NOT_FOUND";
case PEP_SEND_FUNCTION_NOT_REGISTERED: return "PEP_SEND_FUNCTION_NOT_REGISTERED";
case PEP_CONTRAINTS_VIOLATED: return "PEP_CONTRAINTS_VIOLATED";
case PEP_CANNOT_ENCODE: return "PEP_CANNOT_ENCODE";
case PEP_SYNC_NO_NOTIFY_CALLBACK: return "PEP_SYNC_NO_NOTIFY_CALLBACK";
case PEP_SYNC_ILLEGAL_MESSAGE: return "PEP_SYNC_ILLEGAL_MESSAGE";
case PEP_SYNC_NO_INJECT_CALLBACK: return "PEP_SYNC_NO_INJECT_CALLBACK";
case PEP_SYNC_NO_CHANNEL: return "PEP_SYNC_NO_CHANNEL";
case PEP_SYNC_CANNOT_ENCRYPT: return "PEP_SYNC_CANNOT_ENCRYPT";
case PEP_SYNC_NO_MESSAGE_SEND_CALLBACK: return "PEP_SYNC_NO_MESSAGE_SEND_CALLBACK";
case PEP_SYNC_CANNOT_START: return "PEP_SYNC_CANNOT_START";
case PEP_CANNOT_INCREASE_SEQUENCE: return "PEP_CANNOT_INCREASE_SEQUENCE";
case PEP_STATEMACHINE_ERROR: return "PEP_STATEMACHINE_ERROR";
case PEP_NO_TRUST: return "PEP_NO_TRUST";
case PEP_STATEMACHINE_INVALID_STATE: return "PEP_STATEMACHINE_INVALID_STATE";
case PEP_STATEMACHINE_INVALID_EVENT: return "PEP_STATEMACHINE_INVALID_EVENT";
case PEP_STATEMACHINE_INVALID_CONDITION: return "PEP_STATEMACHINE_INVALID_CONDITION";
case PEP_STATEMACHINE_INVALID_ACTION: return "PEP_STATEMACHINE_INVALID_ACTION";
case PEP_STATEMACHINE_INHIBITED_EVENT: return "PEP_STATEMACHINE_INHIBITED_EVENT";
case PEP_STATEMACHINE_CANNOT_SEND: return "PEP_STATEMACHINE_CANNOT_SEND";
case PEP_COMMIT_FAILED: return "PEP_COMMIT_FAILED";
case PEP_MESSAGE_CONSUME: return "PEP_MESSAGE_CONSUME";
case PEP_MESSAGE_IGNORE: return "PEP_MESSAGE_IGNORE";
case PEP_CANNOT_CONFIG: return "PEP_CANNOT_CONFIG";
case PEP_RECORD_NOT_FOUND: return "PEP_RECORD_NOT_FOUND";
case PEP_CANNOT_CREATE_TEMP_FILE: return "PEP_CANNOT_CREATE_TEMP_FILE";
case PEP_ILLEGAL_VALUE: return "PEP_ILLEGAL_VALUE";
case PEP_BUFFER_TOO_SMALL: return "PEP_BUFFER_TOO_SMALL";
case PEP_OUT_OF_MEMORY: return "PEP_OUT_OF_MEMORY";
case PEP_UNKNOWN_ERROR: return "PEP_UNKNOWN_ERROR";
case PEP_VERSION_MISMATCH: return "PEP_VERSION_MISMATCH";
default:
return "UNKNOWN STATUS";
}
}
}
}

+ 0
- 1
pEp_utility.h View File

@ -90,6 +90,5 @@ namespace pEp {
identity_list *identities(SAFEARRAY * sa);
::message * text_message_to_C(TextMessage *msg);
void text_message_from_C(TextMessage *msg2, const ::message *msg);
string statusToString(PEP_STATUS status);
}
}

Loading…
Cancel
Save