[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "cannot determine image type"



> I am getting the following backtrace when attempting to view a
> particular message.  I can produce the actual message if necessary.
> Anyone know what's going on here?

condition-case() hides the true position where error occurs.  For the
more informative backtrace, re-get it after redefining
wl-message-buffer-display() as below.  I think presenting the error
reproducable message is always welcome.

(defun wl-message-buffer-display (folder number display-type
					 &optional force-reload unread)
  (let* ((msg-id (ignore-errors
		   (elmo-message-field folder number 'message-id)))
	 (fname (elmo-folder-name-internal folder))
	 (hit (wl-message-buffer-cache-hit (list fname number msg-id)))
	 (redisplay nil)
	 entity)
    (when (and hit (not (buffer-live-p hit)))
      (wl-message-buffer-cache-delete (list fname number msg-id))
      (setq hit nil))
    (if hit
	(progn
	  ;; move hit to the top.
	  (wl-message-buffer-cache-sort
	   (wl-message-buffer-cache-entry-make (list fname number msg-id) hit))
	  (with-current-buffer hit
	    ;; Rewind to the top page
	    (widen)
	    (goto-char (point-min))
	    (ignore-errors (wl-message-narrow-to-page))
	    (setq entity wl-message-buffer-mime-entity)
	    (unless (eq wl-message-buffer-cur-display-type display-type)
	      (setq redisplay t))))
      ;; delete tail and add new to the top.
      (setq hit (wl-message-buffer-cache-add (list fname number msg-id)))
      (setq redisplay t))
    (when (or force-reload redisplay)
      ;; (condition-case err
	  (with-current-buffer hit
	    (when (or force-reload
		      (null entity)
		      (not (elmo-mime-entity-display-p
			    entity
			    (if (wl-message-mime-analysis-p display-type)
				'mime
			      'as-is)))
		      (if (wl-message-display-no-merge-p display-type)
			  (elmo-mime-entity-reassembled-p entity)
			(elmo-mime-entity-fragment-p entity)))
	      (setq entity (elmo-message-mime-entity
			    folder
			    number
			    (wl-message-get-original-buffer)
			    (and wl-message-auto-reassemble-message/partial
				 (not (wl-message-display-no-merge-p
				       display-type)))
			    force-reload
			    unread
			    (not (wl-message-mime-analysis-p display-type)))))
	    (unless entity
	      (error "Cannot display message %s/%s" fname number))
	    (wl-message-display-internal entity display-type))
	(quit
	 (wl-message-buffer-cache-delete)
	 (error "Display message %s/%s is quitted" fname number))
	;; (error
	;;  (wl-message-buffer-cache-delete)
	;;  (signal (car err) (cdr err))
	;;  nil))) ;; will not be used
	)
    hit))

-- 
Kazuhiro Ito