Creates a buffer out of bound error.
| 113 | |
| 114 | /// Creates a buffer out of bound error. |
| 115 | static Error buffer_out_of_bound(size_t offset, size_t length, |
| 116 | size_t capacity) { |
| 117 | return Error(ErrorCode::BufferOutOfBound, |
| 118 | "Buffer out of bound: " + std::to_string(offset) + " + " + |
| 119 | std::to_string(length) + " > " + std::to_string(capacity)); |
| 120 | } |
| 121 | |
| 122 | /// Creates an encoding error. |
| 123 | static Error encode_error(const std::string &msg) { |