|
7 | 7 |
|
8 | 8 | const std = @import("std"); |
9 | 9 | const Allocator = std.mem.Allocator; |
| 10 | +const log = std.log.scoped(.aws_sdk); |
10 | 11 |
|
11 | 12 | const http = @import("http.zig"); |
12 | 13 | const date = @import("date.zig"); |
@@ -244,12 +245,14 @@ pub const Client = struct { |
244 | 245 | return error.OutOfMemory; |
245 | 246 |
|
246 | 247 | var response = self.http_client.sendRequest(&request) catch |err| { |
| 248 | + log.debug("IMDS token PUT failed: {s}", .{@errorName(err)}); |
247 | 249 | fillDiagnosticFromError(options.diagnostic, err, "token request failed"); |
248 | 250 | return err; |
249 | 251 | }; |
250 | 252 | defer response.deinit(); |
251 | 253 |
|
252 | 254 | if (!response.isSuccess()) { |
| 255 | + log.debug("IMDS token PUT status={d} body={s}", .{ response.status, response.body }); |
253 | 256 | fillDiagnosticFromStatus(options.diagnostic, @intCast(response.status), "token request failed"); |
254 | 257 | return error.HttpError; |
255 | 258 | } |
@@ -308,12 +311,14 @@ pub const Client = struct { |
308 | 311 | return error.OutOfMemory; |
309 | 312 |
|
310 | 313 | var response = self.http_client.sendRequest(&request) catch |err| { |
| 314 | + log.debug("IMDS GET {s} failed: {s}", .{ path, @errorName(err) }); |
311 | 315 | fillDiagnosticFromError(options.diagnostic, err, "metadata request failed"); |
312 | 316 | return err; |
313 | 317 | }; |
314 | 318 | defer response.deinit(); |
315 | 319 |
|
316 | 320 | if (!response.isSuccess()) { |
| 321 | + log.debug("IMDS GET {s} status={d} body={s}", .{ path, response.status, response.body }); |
317 | 322 | fillDiagnosticFromStatus(options.diagnostic, @intCast(response.status), "metadata request failed"); |
318 | 323 | return error.HttpError; |
319 | 324 | } |
|
0 commit comments