Skip to content

Gracefully fail if the avatar is nil? #52

@pcn

Description

@pcn

I'm not sure how this happened, but when trying to retrieve my avatar from gravatar at some point the url-copy-file fails. I've disabled avatar loading for now, but it would be nice if blamer could detect the failure and let me know what the problem is.

The stack follows, with my email address removed:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  puny-encode-domain(nil)
  open-network-stream(nil #<buffer  *url-http-temp*> nil 443 :nowait nil :tls-parameters nil :coding nil)
  open-gnutls-stream(nil #<buffer  *url-http-temp*> nil 443 (:type tls :nowait nil))
  network-stream-open-tls(nil #<buffer  *url-http-temp*> nil 443 (:type tls :nowait nil))
  open-network-stream(nil #<buffer  *url-http-temp*> nil 443 :type tls :nowait nil)
  url-open-stream(nil #<buffer  *url-http-temp*> nil 443 tls)
  url-http-find-free-connection(nil 443 tls)
  url-http(#s(url :type "https" :user nil :password nil :host nil :portspec nil :filename "/www.gravatar.com/avatar/7c7a3ee995b5aabbf43034f88..." :target nil :attributes nil :fullness nil :silent nil :use-cookies t :asynchronous nil) #f(compiled-function (&rest args) #<bytecode -0x531df4bd10bbb11>) ((:redirect "https:/www.gravatar.com/avatar/7c7a3ee995b5aabbf43...")) nil tls)
  url-https(#s(url :type "https" :user nil :password nil :host nil :portspec nil :filename "/www.gravatar.com/avatar/7c7a3ee995b5aabbf43034f88..." :target nil :attributes nil :fullness nil :silent nil :use-cookies t :asynchronous nil) #f(compiled-function (&rest args) #<bytecode -0x531df4bd10bbb11>) ((:redirect "https:/www.gravatar.com/avatar/7c7a3ee995b5aabbf43...")))
  url-retrieve-internal("https:/www.gravatar.com/avatar/7c7a3ee995b5aabbf43034f88aaf2ead?d=identicon" #f(compiled-function (&rest args) #<bytecode -0x531df4bd10bbb11>) ((:redirect "https:/www.gravatar.com/avatar/7c7a3ee995b5aabbf43...")) nil nil)
  url-http-parse-headers()
  url-http-content-length-after-change-function(235 398 163)
  url-http-wait-for-headers-change-function(1 406 405)
  url-http-generic-filter(#<process www.gravatar.com> "HTTP/1.1 301 Moved Permanently\15\nServer: nginx\15\nDat...")
  accept-process-output(nil 0.05)
  url-retrieve-synchronously("http://www.gravatar.com/avatar/7c7a3ee995b5aabbf43034f88aaf2ead?d=identicon")
  url-copy-file("http://www.gravatar.com/avatar/7c7a3ee995b5aabbf43..." "~/.blamer/avatars/api.github.com/<email address removed>.png" t)
  blamer--upload-avatar("http://www.gravatar.com/avatar/7c7a3ee995b5aabbf43..." "~/.blamer/avatars/api.github.com/<email address removed>.png")
  blamer--fallback-avatar-uploader("http://www.gravatar.com/avatar" "~/.blamer/avatars/api.github.com/<email address removed>..." "<email address removed>")
  blamer--github-avatar-uploader("https://api.github.com/search/users" "~/.blamer/avatars/api.github.com/<email address removed>..." "<email address removed>")
  blamer--get-avatar("<email address removed>")
  blamer--parse-line-info("3b120969 (Peter C. Norton 2023-07-21 22:59:06 -040..." (posframe-popup overlay-popup))
  blamer--render(posframe-popup)
  blamer-show-commit-info(posframe-popup)
  blamer-show-posframe-commit-info()
  funcall-interactively(blamer-show-posframe-commit-info)
  command-execute(blamer-show-posframe-commit-info)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions