Giter Club home page Giter Club logo

Comments (4)

iawia002 avatar iawia002 commented on May 13, 2024

@lamg I tried this:

annie -i -s 127.0.0.1:1080 -p https://www.youtube.com/watch\?v\=4FE79y_JkCE\&list\=PLGxuz-nmYlQMO2wRhUhV_g6AN3vLN_4X7

   Site:   YouTube youtube.com
  Title:   Graph Theory:64. Vertex Colouring
   Type:   video
Quality:   hd720
   Size:   63.57 MiB (66657987 Bytes)


   Site:   YouTube youtube.com
  Title:   Graph Theory:65. 2-Chromatic Graphs
   Type:   video
Quality:   hd720
   Size:   45.82 MiB (48050601 Bytes)

^C

but everything is normal here. Can you retry this to see it still wrong?

from lux.

lamg avatar lamg commented on May 13, 2024

The following code (from request.go) causes this error, is wrong because input/output errors shouldn't be treated as exceptional:

res, err := client.Do(req)
	if err != nil {
		log.Print(url)
		panic(err)
}

You should return the error value.

from lux.

iawia002 avatar iawia002 commented on May 13, 2024

You mean to ignore this error?

res, _ := client.Do(req)

But I don't understand why you got this Bad Gateway error

from lux.

lamg avatar lamg commented on May 13, 2024

I mean it shouldn't be treated as something worth of a panic call. Checkout the pattern I use for handling errors in https://github.com/lamg/pmproxy/blob/master/cmd/pmproxy/main.go. Every error in internal procedures is returned, the command line interface handles them at the end, because showing messages to the user is its concern.

The Bad Gateway probably is a consequence of using a very busy HTTP proxy server with little bandwidth for serving its clients.

from lux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.