Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug when using timeout() inside Halite::Client.new do #97

Closed
oprypin opened this issue Jan 16, 2021 · 0 comments · Fixed by #98
Closed

Bug when using timeout() inside Halite::Client.new do #97

oprypin opened this issue Jan 16, 2021 · 0 comments · Fixed by #98

Comments

@oprypin
Copy link
Contributor

oprypin commented Jan 16, 2021

I think this line has a bug because it looks different from other lines around it:

def timeout(timeout : Int32? | Float64? | Time::Span?)
timeout ? timeout(timeout, timeout, timeout) : branch
end

I have this code

c = Halite::Client.new do
  endpoint("https://example.com/")
  timeout(1.seconds)
  logging(skip_request_body: true, skip_response_body: true)
end

I get this error

 92 | timeout(1.seconds)
      ^------
Error: instantiating 'timeout(Time::Span)'


In lib/halite/src/halite/chainable.cr:224:54

 224 | timeout ? timeout(timeout, timeout, timeout) : branch
                                                      ^-----
Error: instantiating 'branch()'


In lib/halite/src/halite/client.cr:275:23

 275 | oneshot_options.merge!(options)
                       ^-----
Error: no overload matches 'Halite::Options#merge!' with type Nil

Overloads are:
 - Halite::Options#merge!(other : Halite::Options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants