question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trying to Get Started - but samples don't work

See original GitHub issue

Bug Report

Description

I’m trying to get started with Fuel, but the sample snippets are not working.

To Reproduce

Steps to reproduce the behavior: With Kotlin 1.3 in Intelij, The Quick start snippet:

/"https://httpbin.org/get"
  .httpGet()
  .responseString { request, response, result ->
    when (result) {
      is Result.Failure -> {
        val ex = result.getException()
      }
      is Result.Success -> {
        val data = result.get()
      }
    }
  }

Gives 2 compile errors:

  1. Result.Success is marked as a type mismatch for result
  2. Result.Failure is marked as hidden.

If I remove that code, and replace the responseString lambda with a println, the println nver triggers and a tcpdump shows that no http request was ever sent.

Expected behavior

No compile errors and at least a failure response

Development Machine

Complete the following information if applicable

  • OS: Fedora 30
  • IDE: IntelliJ
  • Fuel version: 2.1.0
  • Kotlin version: 1.3

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mbidewellcommented, Jun 28, 2019

Yup that works! Thanks! Sorry about that. Might I suggest though that a synchronous example be added to the docs? I thought that by not including the coroutines package, that I was disabling asynch.

0reactions
kittinunfcommented, Jun 30, 2019

No need to be sorry! @mbidewell Thanks for using the library though! Also, if you like to help us, you can send a PR as well (only improving the doc is more than perfect, to be honest, we want to help you and others have a pleasant time using our library). Cheers! 🍺

Read more comments on GitHub >

github_iconTop Results From Across the Web

If Logic Pro isn't working - Apple Support
Learn what to do if Logic Pro won't open, you can't play or record in a project, or you're having another issue.
Read more >
Product Sampling: Tips To Encourage Repeat Orders (2022)
Product sampling is the process of giving free samples away to customers. The idea is, once they try the product for free, they'll...
Read more >
Create YouTube Shorts with sampled content - Google Help
Go to the video that you want to sample. Under the video player, tap Create and then Sound . If you upload a...
Read more >
3.2.2 Probability sampling - Statistique Canada
Statistics: Power from Data! is a web resource that was created in 2001 to ... Then, draw out 10 titles and you will...
Read more >
Load or unload a template or add-in program - Microsoft Support
Control which add-ons and templates are available for your documents. ... If the template or add-in you want does not appear in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found