http_client: dependency stub returns error object as first value instead of nil, err #12
Labels
No labels
coordination/cross-repo
coordination/needed
effort
large
effort
medium
effort
small
meta/duplicate
meta/planning
meta/wontfix
priority
high
priority
low
priority
medium
session
blocker
session
handover
session
next
status
blocked
status
done
status
in-progress
status
review
status
to-go
type
admin
type
bug
type
config
type
deployment
type
docs
type
enhancement
type
feature
type
handover
type
infrastructure
type
installation
type
maintenance
type
migration
type
research
type
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
DAW/daw-lua-net#12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The dependency stub in
http_client.luareturns the daw_error/v1object as its first return value instead of
nil, err:fail()in this file returns a single value (the error object). Thecomment above the stub says it returns
nil, daw_error/v1, and everypublic function of the module is documented as
result | nil, err.Effect when socket.http, ltn12 or daw.common.json is missing:
A caller checking
if not resulttreats the error as a successfulresult. Reproduced by making
require("socket.http")fail and callinghttp.get.Scope
nil, fail(...)from the stub (same as the public functions).result == nil,daw_error.is_error(err),err.data.dependency.Acceptance criteria
nil, daw_error/v1Related
Found while working on DAW/daw-lua-net#10.