Skip to content

Commit 7ac8a5e

Browse files
committed
assert the http request
1 parent 6304080 commit 7ac8a5e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

openai/init.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,13 +379,13 @@ do
379379
if stream_fn then
380380
sink = ltn12.sink.chain(stream_fn, sink)
381381
end
382-
local _, status, out_headers = self:get_http().request({
382+
local _, status, out_headers = assert(self:get_http().request({
383383
sink = sink,
384384
source = source,
385385
url = url,
386386
method = method,
387387
headers = headers
388-
})
388+
}))
389389
local response = table.concat(out)
390390
pcall(function()
391391
response = cjson.decode(response)

openai/init.moon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ class OpenAI
397397
if stream_fn
398398
sink = ltn12.sink.chain stream_fn, sink
399399

400-
_, status, out_headers = @get_http!.request {
400+
_, status, out_headers = assert @get_http!.request {
401401
:sink
402402
:source
403403
:url

0 commit comments

Comments
 (0)