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

Panic on instagram failure #3048

Closed
bep opened this Issue Feb 17, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@bep
Member

bep commented Feb 17, 2017

Wrong ID in short code etc. Should be handled more grafefully.

ERROR 2017/02/17 15:10:23 Retry #1 for https://api.instagram.com/oembed/?url=https://instagram.com/p/BN1pgzujlyP-/&hidecaption=0 and sleeping for 2s
panic: reflect: Zero(nil) [recovered]
	panic: reflect: Zero(nil)

goroutine 356 [running]:
panic(0x636960, 0xc422ff9460)
	/usr/local/Cellar/go/1.7.4/libexec/src/runtime/panic.go:500 +0x1a1
text/template.errRecover(0xc423e71830)
	/usr/local/Cellar/go/1.7.4/libexec/src/text/template/exec.go:146 +0x18e
panic(0x636960, 0xc422ff9460)
	/usr/local/Cellar/go/1.7.4/libexec/src/runtime/panic.go:458 +0x243
reflect.Zero(0x0, 0x0, 0x656440, 0xc42208f1e8, 0x94)
	/usr/local/Cellar/go/1.7.4/libexec/src/reflect/value.go:2104 +0x13d
text/template.(*state).validateType(0xc423e717b0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
	/usr/local/Cellar/go/1.7.4/libexec/src/text/template/exec.go:681 +0x5c1
text/template.(*state).evalArg(0xc423e717b0, 0x6914c0, 0xc4236c7200, 0x16, 0x0, 0x0, 0xa38d80, 0xc42020e5a0, 0x0, 0x0, ...)
	/usr/local/Cellar/go/1.7.4/libexec/src/text/template/exec.go:727 +0x72b
text/template.(*state).evalChainNode(0xc423e717b0, 0x6914c0, 0xc4236c7200, 0x16, 0xc4211d8580, 0xc4201fd7b0, 0x1, 0x1, 0x0, 0x0, ...)

@bep bep added the Bug label Feb 17, 2017

@moorereason moorereason self-assigned this Feb 17, 2017

@moorereason

This comment has been minimized.

Show comment
Hide comment
@moorereason

moorereason Feb 17, 2017

Contributor

Should we show an error in the HTML output?

Contributor

moorereason commented Feb 17, 2017

Should we show an error in the HTML output?

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Feb 17, 2017

Member

Should we show an error in the HTML output?

I guess the HTML output could be an empty string, but the most important part is that it should not take down the dev server, so:

  1. Log it as an ERROR with a useful error message (including page filename)
  2. Empty output (not sure about that, but I guess it is better than coming up with a pleasing error label)
Member

bep commented Feb 17, 2017

Should we show an error in the HTML output?

I guess the HTML output could be an empty string, but the most important part is that it should not take down the dev server, so:

  1. Log it as an ERROR with a useful error message (including page filename)
  2. Empty output (not sure about that, but I guess it is better than coming up with a pleasing error label)

@bep bep added this to the v0.19 milestone Feb 17, 2017

moorereason added a commit to moorereason/hugo that referenced this issue Feb 17, 2017

tplimpl: Fix instagram shortcode panic on invalid ID
Instagram doesn't return a valid JSON response when the requested ID is
invalid or not found.

Fixes #3048

@bep bep closed this in #3049 Feb 17, 2017

bep added a commit that referenced this issue Feb 17, 2017

tplimpl: Fix instagram shortcode panic on invalid ID
Instagram doesn't return a valid JSON response when the requested ID is
invalid or not found.

Fixes #3048
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment