ops::model_error class

Runtime errors related to ops::model documents.

Public types

enum model_error_type { document_not_found, bad_oid, bad_bson_data }
The types of errors reprensented by this class.

Constructors, destructors, conversion operators

model_error(const model_error_type type, const std::string& message)
Default constructor.

Public functions

auto type() const -> model_error_type

Function documentation

ops::model_error::model_error(const model_error_type type, const std::string& message)

Default constructor.

Example of throwing a model_error exception:

throw model_error{model_error::bad_bson_data, "bad BSON"};

model_error_type ops::model_error::type() const

Returns the type of error raised