From c6eb2a1278305f96cc02cff661ee8a8fb449fff6 Mon Sep 17 00:00:00 2001 From: Elis Axelsson Date: Fri, 7 Oct 2016 22:53:24 +0200 Subject: [PATCH] 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