michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: package org.mozilla.gecko.tokenserver; michael@0: michael@0: import java.util.List; michael@0: michael@0: import org.mozilla.gecko.sync.ExtendedJSONObject; michael@0: michael@0: public class TokenServerException extends Exception { michael@0: private static final long serialVersionUID = 7185692034925819696L; michael@0: michael@0: public final List errors; michael@0: michael@0: public TokenServerException(List errors) { michael@0: super(); michael@0: this.errors = errors; michael@0: } michael@0: michael@0: public TokenServerException(List errors, String string) { michael@0: super(string); michael@0: this.errors = errors; michael@0: } michael@0: michael@0: public TokenServerException(List errors, Throwable e) { michael@0: super(e); michael@0: this.errors = errors; michael@0: } michael@0: michael@0: public static class TokenServerConditionsRequiredException extends TokenServerException { michael@0: private static final long serialVersionUID = 7578072663150608399L; michael@0: michael@0: public final ExtendedJSONObject conditionUrls; michael@0: michael@0: public TokenServerConditionsRequiredException(ExtendedJSONObject urls) { michael@0: super(null); michael@0: this.conditionUrls = urls; michael@0: } michael@0: } michael@0: michael@0: public static class TokenServerInvalidCredentialsException extends TokenServerException { michael@0: private static final long serialVersionUID = 7578072663150608398L; michael@0: michael@0: public TokenServerInvalidCredentialsException(List errors) { michael@0: super(errors); michael@0: } michael@0: michael@0: public TokenServerInvalidCredentialsException(List errors, String message) { michael@0: super(errors, message); michael@0: } michael@0: } michael@0: michael@0: public static class TokenServerUnknownServiceException extends TokenServerException { michael@0: private static final long serialVersionUID = 7578072663150608397L; michael@0: michael@0: public TokenServerUnknownServiceException(List errors) { michael@0: super(errors); michael@0: } michael@0: michael@0: public TokenServerUnknownServiceException(List errors, String message) { michael@0: super(errors, message); michael@0: } michael@0: } michael@0: michael@0: public static class TokenServerMalformedRequestException extends TokenServerException { michael@0: private static final long serialVersionUID = 7578072663150608396L; michael@0: michael@0: public TokenServerMalformedRequestException(List errors) { michael@0: super(errors); michael@0: } michael@0: michael@0: public TokenServerMalformedRequestException(List errors, String message) { michael@0: super(errors, message); michael@0: } michael@0: } michael@0: michael@0: public static class TokenServerMalformedResponseException extends TokenServerException { michael@0: private static final long serialVersionUID = 7578072663150608395L; michael@0: michael@0: public TokenServerMalformedResponseException(List errors, String message) { michael@0: super(errors, message); michael@0: } michael@0: michael@0: public TokenServerMalformedResponseException(List errors, Throwable e) { michael@0: super(errors, e); michael@0: } michael@0: } michael@0: }