12

Well shit.

Recently refactored some backend code that makes some https requests.

I realized I was repeating myself a lot with the request options so I decided to make a function to generate the options with defaults.

Works great, shortened my requests to almost nothing.

The problem is it wasn't working great.

It took me about an hour to finally figure out that the requests were failing because I forgot to return the options object after I created it.

Sending the request with null options just makes it act as if the options are there, but incorrect, so I was totally lost.

FML

Comments
  • 4
    Reminds me of first time I faced: Error on line 100 when my file had 80 lines of code, took me couple of days to finally figure out that Gradle needed cache clearing
Add Comment