| 204 | * @since 4.0.0 |
| 205 | */ |
| 206 | export class TransportError extends ReasonError("TransportError")<{ |
| 207 | readonly request: HttpClientRequest.HttpClientRequest |
| 208 | readonly cause?: unknown |
| 209 | readonly description?: string |
| 210 | }> { |
| 211 | /** |
| 212 | * Formats the request method and URL for transport error messages. |
| 213 | * |
| 214 | * @stability unstable |
| 215 | * @since 4.0.0 |
| 216 | */ |
| 217 | get methodAndUrl() { |
| 218 | return formatMethodAndUrl(this) |
| 219 | } |
| 220 | |
| 221 | /** |
| 222 | * Builds the transport error message from the optional description and request details. |
| 223 | * |
| 224 | * @stability unstable |
| 225 | * @since 4.0.0 |
| 226 | */ |
| 227 | override get message() { |
| 228 | return formatMessage(formatReason(this._tag), this.description, this.methodAndUrl) |
| 229 | } |
| 230 | |
| 231 | override toJSON(): unknown { |
| 232 | return reasonToJSON(this, super.toJSON()) |
| 233 | } |
| 234 | } |
| 235 | |
| 236 | /** |
| 237 | * Error describing failures while encoding an HTTP request body. |
nothing calls this directly
no test coverage detected