[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/rt-liberation 246acd2 06/72: * rt-liberation.el: Attemp
From: |
Stefan Monnier |
Subject: |
[elpa] externals/rt-liberation 246acd2 06/72: * rt-liberation.el: Attempt to handle server response when assigning. |
Date: |
Wed, 5 Aug 2020 11:57:32 -0400 (EDT) |
branch: externals/rt-liberation
commit 246acd2c960c57a678640aaf5ce6993b72b2e67a
Author: Yoni Rabkin <yonirabkin@member.fsf.org>
Commit: Yoni Rabkin <yonirabkin@member.fsf.org>
* rt-liberation.el: Attempt to handle server response when assigning.
---
rt-liberation.el | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/rt-liberation.el b/rt-liberation.el
index 1ff4389..995a767 100644
--- a/rt-liberation.el
+++ b/rt-liberation.el
@@ -1202,14 +1202,28 @@ If FIELD already exists, update to VALUE."
(rt-liber-command-set-status
id (rt-liber-command-get-status-string 'open)))
+;; This is brittle because the server doesn't respond with a code but
+;; with some free text, and we have no guarantee that the text will be
+;; stable from version to version.
+(defun rt-liber-handle-response-set-owner (response)
+ "Handle the response from the RT server. Pass on the response."
+ (when
+ (with-temp-buffer
+ (insert response)
+ (goto-char (point-min))
+ (re-search-forward "That user does not exist" (point-max) t))
+ (error "that user does not exist"))
+ response)
+
(defun rt-liber-command-set-owner (id owner)
"Set the owner of ticket ID to OWNER."
(let ((command (rt-liber-command-get-command-string 'edit))
(args
(format "ticket/%s set owner=%s" id owner)))
- (rt-liber-parse-answer
- (rt-liber-command-runner command args)
- 'rt-liber-command-runner-parser-f)))
+ (rt-liber-handle-response-set-owner
+ (rt-liber-parse-answer
+ (rt-liber-command-runner command args)
+ 'rt-liber-command-runner-parser-f))))
(defun rt-liber-command-set-queue (id queue)
"Set the queue of ticket ID to QUEUE."
- [elpa] branch externals/rt-liberation created (now 05beb9f), Stefan Monnier, 2020/08/05
- [elpa] externals/rt-liberation 6eeb9ca 02/72: * rt-liberation.el: Change mode even when signalling the no-results exception., Stefan Monnier, 2020/08/05
- [elpa] externals/rt-liberation ecd9c12 03/72: * doc/rt-liberation.texinfo: A patch to fix some typos in the documentation is attached., Stefan Monnier, 2020/08/05
- [elpa] externals/rt-liberation e772549 05/72: * rt-liberation.el: Bump copyright notice., Stefan Monnier, 2020/08/05
- [elpa] externals/rt-liberation 5de9af6 01/72: import for initial Savannah tree, Stefan Monnier, 2020/08/05
- [elpa] externals/rt-liberation 96cc027 04/72: * rt-liberation.el: Add a debug option., Stefan Monnier, 2020/08/05
- [elpa] externals/rt-liberation 246acd2 06/72: * rt-liberation.el: Attempt to handle server response when assigning.,
Stefan Monnier <=
- [elpa] externals/rt-liberation 146b0ed 07/72: Add makefile., Stefan Monnier, 2020/08/05
- [elpa] externals/rt-liberation 1aa19e9 08/72: Fix compilation errors., Stefan Monnier, 2020/08/05
- [elpa] externals/rt-liberation e81b0a3 09/72: * rt-liberation-gnus.el: Fix compile warnings., Stefan Monnier, 2020/08/05
- [elpa] externals/rt-liberation 4dd2f82 11/72: * rt-liberation-gnus.el: Fix single line and leading space bugs., Stefan Monnier, 2020/08/05
- [elpa] externals/rt-liberation 7bc66d0 12/72: * rt-liberation.el: Add %-sequence support for priority., Stefan Monnier, 2020/08/05
- [elpa] externals/rt-liberation 6a51214 13/72: * rt-liberation.el: Add a custom time format string., Stefan Monnier, 2020/08/05
- [elpa] externals/rt-liberation 2c9b357 10/72: Fix compilation warnings., Stefan Monnier, 2020/08/05
- [elpa] externals/rt-liberation f0cf810 23/72: * doc/rt-liberation.texinfo: Update manual., Stefan Monnier, 2020/08/05
- [elpa] externals/rt-liberation b506154 14/72: * rt-liberation.el: Update the browser display format., Stefan Monnier, 2020/08/05
- [elpa] externals/rt-liberation 757d808 16/72: * rt-liberation.el: Add keybinding., Stefan Monnier, 2020/08/05