xapian-core
1.4.26
|
functions to convert Xapian::Error objects to strings and back More...
#include <config.h>
#include <xapian/error.h>
#include "length.h"
#include "serialise-error.h"
#include <string>
#include "xapian/errordispatch.h"
Go to the source code of this file.
Functions | |
string | serialise_error (const Xapian::Error &e) |
Serialise a Xapian::Error object to a string. More... | |
void | unserialise_error (const string &serialised_error, const string &prefix, const string &new_context) |
Unserialise a Xapian::Error object and throw it. More... | |
functions to convert Xapian::Error objects to strings and back
Definition in file serialise-error.cc.
string serialise_error | ( | const Xapian::Error & | e | ) |
Serialise a Xapian::Error object to a string.
e | The Xapian::Error object to serialise. |
Definition at line 33 of file serialise-error.cc.
References encode_length(), Xapian::Error::get_context(), Xapian::Error::get_error_string(), Xapian::Error::get_msg(), and Xapian::Error::get_type().
Referenced by RemoteServer::RemoteServer(), RemoteServer::run(), and test_serialiseerror1().
void unserialise_error | ( | const std::string & | error_string, |
const std::string & | prefix, | ||
const std::string & | new_context | ||
) |
Unserialise a Xapian::Error object and throw it.
Note: does not return!
error_string | The string to unserialise. |
prefix | Optional prefix to prepend to the unserialised Error's msg field. |
new_context | Optional context to replace the context in the error. If this is specified, any existing context will be noted in the Error's msg field. |
Definition at line 48 of file serialise-error.cc.
References decode_length_and_check().
Referenced by RemoteDatabase::get_message(), and test_serialiseerror1().