Skip to content

Instantly share code, notes, and snippets.

@cvmat
Created October 11, 2010 04:05
Show Gist options
  • Save cvmat/619954 to your computer and use it in GitHub Desktop.
Save cvmat/619954 to your computer and use it in GitHub Desktop.
diff -r 915094a3e32c twittering-mode.el
--- a/twittering-mode.el Sat Oct 09 20:17:55 2010 +0900
+++ b/twittering-mode.el Tue Oct 12 00:05:52 2010 +0900
@@ -2651,7 +2651,19 @@
'decode-char 'after 'twittering-add-fail-over-to-decode-char)
(ad-activate 'decode-char)
(unwind-protect
- (apply 'xml-parse-region args)
+ (condition-case error-info
+ (apply 'xml-parse-region args)
+ (error
+ (let ((buffer (current-buffer)))
+ (with-current-buffer (twittering-debug-buffer)
+ (when (boundp 'header-info)
+ (if (require 'pp nil t)
+ (insert (pp-to-string header-info))
+ (insert (format "header-info=%s" header-info))))
+ (insert-buffer-substring buffer)))
+ (message "%s" (error-message-string error-info))
+ (apply 'signal error-info)
+ nil))
(ad-disable-advice 'decode-char 'after
'twittering-add-fail-over-to-decode-char)
(if activated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment