emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/webpaste c6eb2a1 031/298: Add error callbacks to try to pa


From: ELPA Syncer
Subject: [nongnu] elpa/webpaste c6eb2a1 031/298: Add error callbacks to try to paste again (to
Date: Thu, 9 Dec 2021 18:59:38 -0500 (EST)

branch: elpa/webpaste
commit c6eb2a1278305f96cc02cff661ee8a8fb449fff6
Author: Elis Axelsson <elis.axelsson@gmail.com>
Commit: Elis Axelsson <elis.axelsson@gmail.com>

    Add error callbacks to try to paste again (to
    another service)
---
 webpaste.el | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/webpaste.el b/webpaste.el
index 7cd34e3..35f602a 100644
--- a/webpaste.el
+++ b/webpaste.el
@@ -66,7 +66,11 @@ each run.")
                   :parser 'buffer-string
                   :success (function* (lambda (&key data &allow-other-keys)
                                         (when data
-                                          (webpaste-return-url data))))))
+                                          (webpaste-return-url data))))
+                  :error
+                  (function* (lambda (&key error-thrown &allow-other-keys&rest 
_)
+                               (message "Got error: %S" error-thrown)
+                               (webpaste-paste-text text)))))
        nil))
     ("dpaste.com" .
      (lambda (text)
@@ -89,7 +93,11 @@ each run.")
                   :success
                   (function* (lambda (&key response &allow-other-keys)
                                (webpaste-return-url
-                                (request-response-header response 
"Location"))))))
+                                (request-response-header response 
"Location"))))
+                  :error
+                  (function* (lambda (&key error-thrown &allow-other-keys&rest 
_)
+                               (message "Got error: %S" error-thrown)
+                               (webpaste-paste-text text)))))
        nil)))
   "Define all webpaste.el providers.
 Consists of provider name and lambda function to do the actuall call to the



reply via email to

[Prev in Thread] Current Thread [Next in Thread]