11#include <userver/storages/postgres/dsn.hpp> 
   12#include <userver/storages/postgres/io/traits.hpp> 
   13#include <userver/storages/postgres/message.hpp> 
   15#include <userver/compiler/demangle.hpp> 
   16#include <userver/utils/underlying_value.hpp> 
   18USERVER_NAMESPACE_BEGIN
 
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
   88
   89
   90
   91
   92
   93
   94
   95
   96
   97
   98
   99
  100
  101
  102
  103
  104
  105
  106
  107
  108
  109
  110
  111
  112
  113
  114
  115
  116
  117
  118
  119
  120
  121
  122
  123
  124
  125
  126
  127
  128
  129
  130
  131
  132
  133
  134
  135
  136
  137
  138
  139
  140
  141
  142
  143
  144
  145
  146
  147
  148
  149
  150
  151
  152
  153
  154
  155
  156
  157
  158
  159
  160
  161
  162
  168class Error : 
public std::runtime_error {
 
  169  using runtime_error::runtime_error;
 
  191template <
typename Base>
 
  194  explicit ServerError(
const Message& msg)
 
  195      : Base(msg.GetMessage()), msg_{msg} {}
 
  197  const Message& GetServerMessage() 
const { 
return msg_; }
 
  199  Message::Severity GetSeverity() 
const { 
return msg_.GetSeverity(); }
 
  200  SqlState GetSqlState() 
const { 
return msg_.GetSqlState(); }
 
  219  explicit ConnectionFailed(
const Dsn& dsn);
 
  220  ConnectionFailed(
const Dsn& dsn, std::string_view message);
 
  233  PoolError(std::string_view msg, std::string_view db_name);
 
  234  PoolError(std::string_view msg);
 
  346  std::string GetSchema() 
const;
 
  347  std::string GetTable() 
const;
 
  348  std::string GetConstraint() 
const;
 
  592  AlreadyInTransaction();
 
  598  NotInTransaction(
const std::string& msg);
 
  603  TransactionForceRollback();
 
  604  TransactionForceRollback(
const std::string& msg);
 
  614  ResultSetError(std::string msg);
 
  616  void AddMsgSuffix(std::string_view str);
 
  618  const char* what() 
const noexcept override;
 
  627  RowIndexOutOfBounds(std::size_t index);
 
  633  FieldIndexOutOfBounds(std::size_t index);
 
  639  FieldNameDoesntExist(std::string_view name);
 
  646  template <
typename T>
 
  647  FieldValueIsNull(std::size_t field_index, std::string_view field_name,
 
  649      : ResultSetError(fmt::format(
"Field #{} name `{}` C++ type `{}` value is " 
  650                                   "null, forgot `std::optional`?",
 
  651                                   field_index, field_name,
 
  652                                   compiler::GetTypeName<T>())) {}
 
  660  TypeCannotBeNull(std::string_view type);
 
  677  UnknownBufferCategory(std::string_view context, Oid type_oid);
 
  691  InvalidInputBufferSize(std::size_t size, std::string_view message);
 
  698  InvalidBinaryBuffer(
const std::string& message);
 
  705  InvalidTupleSizeRequested(std::size_t field_count, std::size_t tuple_size);
 
  712  NonSingleColumnResultSet(std::size_t actual_size,
 
  713                           const std::string& type_name,
 
  714                           const std::string& func);
 
  720  explicit NonSingleRowResultSet(std::size_t actual_size);
 
  727  FieldTupleMismatch(std::size_t field_count, std::size_t tuple_size);
 
  742  CompositeSizeMismatch(std::size_t pg_size, std::size_t cpp_size,
 
  743                        std::string_view cpp_type);
 
  750  CompositeMemberTypeMismatch(std::string_view pg_type_schema,
 
  751                              std::string_view pg_type_name,
 
  752                              std::string_view field_name, Oid pg_oid,
 
  774  InvalidDimensions(std::size_t expected, std::size_t actual);
 
  818  InvalidEnumerationLiteral(std::string_view type_name,
 
  819                            std::string_view literal);
 
  824  template <
typename Enum>
 
  825  explicit InvalidEnumerationValue(Enum val)
 
  827            fmt::format(
"Invalid enumeration value '{}' for enum type '{}'",
 
  828                        USERVER_NAMESPACE::utils::UnderlyingValue(val),
 
  829                        compiler::GetTypeName<Enum>())) {}
 
  837  UnsupportedInterval();
 
  843  BoundedRangeError(std::string_view message);
 
  858  BitStringOverflow(std::size_t actual, std::size_t expected);
 
  864  InvalidBitStringRepresentation();
 
  872  InvalidDSN(std::string_view dsn, std::string_view err);
 
  894  explicit IpAddressInvalidFormat(std::string_view str);