| 241 | * @since 4.0.0 |
| 242 | */ |
| 243 | export class EncodeError extends ReasonError("EncodeError")<{ |
| 244 | readonly request: HttpClientRequest.HttpClientRequest |
| 245 | readonly cause?: unknown |
| 246 | readonly description?: string |
| 247 | }> { |
| 248 | /** |
| 249 | * Formats the request method and URL for request encoding error messages. |
| 250 | * |
| 251 | * @stability unstable |
| 252 | * @since 4.0.0 |
| 253 | */ |
| 254 | get methodAndUrl() { |
| 255 | return formatMethodAndUrl(this) |
| 256 | } |
| 257 | |
| 258 | /** |
| 259 | * Builds the request encoding error message from the optional description and request details. |
| 260 | * |
| 261 | * @stability unstable |
| 262 | * @since 4.0.0 |
| 263 | */ |
| 264 | override get message() { |
| 265 | return formatMessage(formatReason(this._tag), this.description, this.methodAndUrl) |
| 266 | } |
| 267 | |
| 268 | override toJSON(): unknown { |
| 269 | return reasonToJSON(this, super.toJSON()) |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | /** |
| 274 | * Error describing failures while constructing a URL from an HTTP client request. |
nothing calls this directly
no test coverage detected