Skip to content

Commit

Permalink
chore: Add response logging to HTTP
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-valenta committed Dec 18, 2020
1 parent 5bfb79d commit f96584f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/internal/interpreter/map-interpreter.errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ export class HTTPError extends MapInterpreterErrorBase {
body?: unknown;
headers?: Record<string, string>;
url?: string;
},
public response?: {
body?: unknown;
headers?: Record<string, string>;
}
) {
super('HTTPError', message, metadata);
Expand Down
3 changes: 2 additions & 1 deletion src/internal/interpreter/map-interpreter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ export class MapInterpreter<TInput extends NonPrimitive | undefined>
'HTTP Error',
{ node, ast: this.ast },
response.statusCode,
response.debug.request
response.debug.request,
{ body: response.body, headers: response.headers }
);
}
}
Expand Down

0 comments on commit f96584f

Please sign in to comment.