         @setPreviewImage xpath '/atom:entry/media:group/media:thumbnail[@yt:name="default"]/@url'
         @setPreviewTitle xpath '/atom:entry/atom:title'
         @setPreviewLink @uri
+      )
+      .error => @cancel()
 
 class ImgurScraper extends Media.ThumbnailScraper
   Media.register this

      id = @uri.query.v ? @uri.path.match(///^ /v/ (.*) ///)?[1]
    
    if id?
      $.get "https://gdata.youtube.com/feeds/api/videos/#{id}?v=2", (xml) =>
        # jump through hoops for the XPath API
        resolver = (ns) ->
          if ns is 'atom'

      id = @uri.path.match(/// ([^/\.]+) (?: \. [^/\.]+ )? $ ///)?[1]
    
    if id?
      $.getJSON("http://api.imgur.com/2/image/#{id}", (data) =>
        @setPreviewTitle data.image.image.title ? @source.text()
        @setPreviewImage data.image.links.small_square
        @setPreviewLink data.image.links.imgur_page
      )
      .error => @cancel()

class GenericImageScraper extends Media.ThumbnailScraper
  Media.register this
