mobile/android/base/tokenserver/TokenServerException.java

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 package org.mozilla.gecko.tokenserver;
     7 import java.util.List;
     9 import org.mozilla.gecko.sync.ExtendedJSONObject;
    11 public class TokenServerException extends Exception {
    12   private static final long serialVersionUID = 7185692034925819696L;
    14   public final List<ExtendedJSONObject> errors;
    16   public TokenServerException(List<ExtendedJSONObject> errors) {
    17     super();
    18     this.errors = errors;
    19   }
    21   public TokenServerException(List<ExtendedJSONObject> errors, String string) {
    22     super(string);
    23     this.errors = errors;
    24   }
    26   public TokenServerException(List<ExtendedJSONObject> errors, Throwable e) {
    27     super(e);
    28     this.errors = errors;
    29   }
    31   public static class TokenServerConditionsRequiredException extends TokenServerException {
    32     private static final long serialVersionUID = 7578072663150608399L;
    34     public final ExtendedJSONObject conditionUrls;
    36     public TokenServerConditionsRequiredException(ExtendedJSONObject urls) {
    37       super(null);
    38       this.conditionUrls = urls;
    39     }
    40   }
    42   public static class TokenServerInvalidCredentialsException extends TokenServerException {
    43     private static final long serialVersionUID = 7578072663150608398L;
    45     public TokenServerInvalidCredentialsException(List<ExtendedJSONObject> errors) {
    46       super(errors);
    47     }
    49     public TokenServerInvalidCredentialsException(List<ExtendedJSONObject> errors, String message) {
    50       super(errors, message);
    51     }
    52   }
    54   public static class TokenServerUnknownServiceException extends TokenServerException {
    55     private static final long serialVersionUID = 7578072663150608397L;
    57     public TokenServerUnknownServiceException(List<ExtendedJSONObject> errors) {
    58       super(errors);
    59     }
    61     public TokenServerUnknownServiceException(List<ExtendedJSONObject> errors, String message) {
    62       super(errors, message);
    63     }
    64   }
    66   public static class TokenServerMalformedRequestException extends TokenServerException {
    67     private static final long serialVersionUID = 7578072663150608396L;
    69     public TokenServerMalformedRequestException(List<ExtendedJSONObject> errors) {
    70       super(errors);
    71     }
    73     public TokenServerMalformedRequestException(List<ExtendedJSONObject> errors, String message) {
    74       super(errors, message);
    75     }
    76   }
    78   public static class TokenServerMalformedResponseException extends TokenServerException {
    79     private static final long serialVersionUID = 7578072663150608395L;
    81     public TokenServerMalformedResponseException(List<ExtendedJSONObject> errors, String message) {
    82       super(errors, message);
    83     }
    85     public TokenServerMalformedResponseException(List<ExtendedJSONObject> errors, Throwable e) {
    86       super(errors, e);
    87     }
    88   }
    89 }

mercurial