diff --git a/src/org/openstreetmap/josm/data/oauth/OAuthParameters.java b/src/org/openstreetmap/josm/data/oauth/OAuthParameters.java index e58d032421b..86a476057ef 100644 --- a/src/org/openstreetmap/josm/data/oauth/OAuthParameters.java +++ b/src/org/openstreetmap/josm/data/oauth/OAuthParameters.java @@ -9,6 +9,7 @@ import java.util.HashMap; import java.util.Map; +import jakarta.json.stream.JsonParsingException; import org.openstreetmap.josm.io.NetworkManager; import org.openstreetmap.josm.io.OsmApi; import org.openstreetmap.josm.io.auth.CredentialsAgentException; @@ -94,7 +95,7 @@ private static JsonObject getRFC8414Parameters(String apiUrl) { } } } - } catch (URISyntaxException | IOException e) { + } catch (JsonParsingException | URISyntaxException | IOException e) { throw new JosmRuntimeException(e); } finally { if (client != null) { @@ -157,7 +158,8 @@ private static OAuth20Parameters getDefaultOAuth20Parameters(String apiUrl) { } } } catch (JosmRuntimeException e) { - if (e.getCause() instanceof URISyntaxException || e.getCause() instanceof IOException) { + if (e.getCause() instanceof URISyntaxException || e.getCause() instanceof IOException + || e.getCause() instanceof JsonParsingException) { Logging.trace(e); } else { throw e; diff --git a/src/org/openstreetmap/josm/gui/oauth/OAuthAuthorizationWizard.java b/src/org/openstreetmap/josm/gui/oauth/OAuthAuthorizationWizard.java index aa1e37538ca..a4ff52d723e 100644 --- a/src/org/openstreetmap/josm/gui/oauth/OAuthAuthorizationWizard.java +++ b/src/org/openstreetmap/josm/gui/oauth/OAuthAuthorizationWizard.java @@ -175,7 +175,7 @@ protected JPanel buildHeaderInfoPanel() { // the authorisation procedure JMultilineLabel lbl = new JMultilineLabel(AuthorizationProcedure.FULLY_AUTOMATIC.getDescription()); lbl.setFont(lbl.getFont().deriveFont(Font.PLAIN)); - pnl.add(lbl, GBC.std()); + pnl.add(lbl, GBC.eol()); if (!Config.getUrls().getDefaultOsmApiUrl().equals(apiUrl)) { final HtmlPanel pnlWarning = new HtmlPanel();