[josm] 01/02: Backport fixed failed authorisation dialog from 4021, gives more verbose message of why the authorisation process failed. (needed for OSM License Change Phase III)

Bas Couwenberg sebastic at xs4all.nl
Sat Oct 18 12:08:05 UTC 2014


This is an automated email from the git hooks/post-receive script.

sebastic-guest pushed a commit to annotated tag debian/0.0.svn3376-1+squeeze1
in repository josm.

commit e1e97359936936698159549c2bad2da1cf87b554
Author: David Paleino <dapal at debian.org>
Date:   Sat Apr 16 11:24:37 2011 +0200

    Backport fixed failed authorisation dialog from 4021, gives more verbose message of why the authorisation process failed. (needed for OSM License Change Phase III)
---
 debian/changelog                                   |  8 +++
 .../90-backport_failedauth_explaination.patch      | 57 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 66 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 6f8f4fd..7bb70c1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+josm (0.0.svn3376-1+squeeze1) UNRELEASED; urgency=low
+
+  * Backport fixed failed authorisation dialog from 4021, gives
+    more verbose message of why the authorisation process failed.
+    (needed for OSM License Change Phase III)
+
+ -- David Paleino <dapal at debian.org>  Sat, 16 Apr 2011 11:23:15 +0200
+
 josm (0.0.svn3376-1) unstable; urgency=low
 
   * New upstream snapshot
diff --git a/debian/patches/90-backport_failedauth_explaination.patch b/debian/patches/90-backport_failedauth_explaination.patch
new file mode 100644
index 0000000..d1ccec5
--- /dev/null
+++ b/debian/patches/90-backport_failedauth_explaination.patch
@@ -0,0 +1,57 @@
+From: David Paleino <dapal at debian.org>
+Subject: backport fixed failed authorisation dialog from 4021
+Origin: vendor
+Forwarded: not-needed
+
+---
+ src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java |    3 +-
+ src/org/openstreetmap/josm/tools/ExceptionUtil.java     |   24 ++++++++++++++++
+ 2 files changed, 26 insertions(+), 1 deletion(-)
+
+--- josm.orig/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java
++++ josm/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java
+@@ -271,9 +271,10 @@ public class ExceptionDialogUtil {
+      * @param e the exception
+      */
+     public static void explainAuthorizationFailed(OsmApiException e) {
++        // Fixme: add special handling that calls ExceptionUtil.explainFailedOAuthAuthorisation(e)
+         HelpAwareOptionPane.showOptionDialog(
+                 Main.parent,
+-                ExceptionUtil.explainFailedOAuthAuthorisation(e),
++                ExceptionUtil.explainFailedAuthorisation(e),
+                 tr("Authorisation Failed"),
+                 JOptionPane.ERROR_MESSAGE,
+                 ht("/ErrorMessages#AuthenticationFailed")
+--- josm.orig/src/org/openstreetmap/josm/tools/ExceptionUtil.java
++++ josm/src/org/openstreetmap/josm/tools/ExceptionUtil.java
+@@ -128,6 +128,30 @@ public class ExceptionUtil {
+         );
+     }
+ 
++   public static String explainFailedAuthorisation(OsmApiException e) {
++        e.printStackTrace();
++        String header = e.getErrorHeader();
++        String body = e.getErrorBody();
++        String msg = null;
++        if (header != null) {
++            if (body != null && !header.equals(body)) {
++                msg = header + " (" + body + ")";
++            } else {
++                msg = header;
++            }
++        } else {
++            msg = body;
++        }
++
++        return tr("<html>"
++                + "Authorisation at the OSM server failed.<br>"
++                + "The server reported the following error:<br>"
++                + "''{0}''"
++                + "</html>",
++                msg
++        );
++    }
++
+     public static String explainFailedOAuthAuthorisation(OsmApiException e) {
+         e.printStackTrace();
+         return tr("<html>"
diff --git a/debian/patches/series b/debian/patches/series
index 6d571f1..a04db8e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@
 60-port_oauth_1.2.patch
 70-default_look_and_feel.patch
 80-fix_images.patch
+90-backport_failedauth_explaination.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/josm.git



More information about the Pkg-grass-devel mailing list