Skip to content

Commit 8b55e96

Browse files
TheOtherBrian1steve-chavez
authored andcommitted
_http_collect_response now returns an 'ERROR' response when requests times out
Currently, when a request times out, the function returns a "SUCCESS" response. My changes fix this bug.
1 parent 4aac72c commit 8b55e96

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sql/pg_net.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,15 +305,15 @@ begin
305305
from net._http_response
306306
where id = request_id;
307307

308-
if rec is null then
308+
if rec is null or rec.error_msg is not null then
309309
-- The request is either still processing or the request_id provided does not exist
310310

311311
-- TODO: request in progress is indistinguishable from request that doesn't exist
312312

313313
-- No request matching request_id found
314314
return (
315315
'ERROR',
316-
'request matching request_id not found',
316+
coalesce(rec.error_msg, 'request matching request_id not found'),
317317
null
318318
)::net.http_response_result;
319319

0 commit comments

Comments
 (0)