Skip to content

Commit

Permalink
`twittering-extract-timeline-spec' displays more descriptive error.
Browse files Browse the repository at this point in the history
* twittering-mode.el (twittering-extract-timeline-spec): add error
messages for some conditions.
  • Loading branch information
cvmat committed Feb 7, 2010
1 parent 7c19fae commit 6ea8da4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Expand Up @@ -8,6 +8,9 @@
* test/test-twittering-mode.el (timeline-spec): add a test for
trailing backslashes.

* twittering-mode.el (twittering-extract-timeline-spec): add error
messages for some conditions.

2010-02-07 Satoshi Yatagawa <yata_github@y.hauN.org>

* twittering-mode.el (twittering-http-get): Add an optional
Expand Down
8 changes: 8 additions & 0 deletions twittering-mode.el
Expand Up @@ -703,6 +703,7 @@ Return cons of the spec and the rest string."
(error "\"%s\" has no valid regexp" str)
nil))
(t
(error "\"%s\" is invalid as a timeline spec" str)
nil))))
((string-match "^\\$\\([a-zA-Z0-9_-]+\\)" str)
(let* ((name (match-string 1 str))
Expand Down Expand Up @@ -737,9 +738,16 @@ Return cons of the spec and the rest string."
`(,(car spec-list) . ,(substring rest 1))
`((merge ,@spec-list) . ,(substring rest 1))))
(if rest
;; The string following the opening parenthesis `('
;; can be interpreted without errors,
;; but there is no corresponding closing parenthesis.
(error "\"%s\" lacks a closing parenthesis" str))
;; Does not display additional error messages if an error
;; occurred on interpreting the string following
;; the opening parenthesis `('.
nil)))
(t
(error "\"%s\" is invalid as a timeline spec" str)
nil)
))

Expand Down

0 comments on commit 6ea8da4

Please sign in to comment.