Skip to content

Commit d1893b5

Browse files
committed
Merge pull request OfficeDev#323 from serious6/refactorExceptions
Refactor exceptions package
2 parents 81bef01 + 9b2885f commit d1893b5

233 files changed

Lines changed: 918 additions & 905 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/main/java/microsoft/exchange/webservices/data/ISelfValidate.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
package microsoft.exchange.webservices.data;
2525

26-
import microsoft.exchange.webservices.data.exception.ServiceValidationException;
26+
import microsoft.exchange.webservices.data.core.exception.service.local.ServiceValidationException;
2727

2828
/**
2929
* The Interface ISelfValidate.
@@ -33,7 +33,7 @@ public interface ISelfValidate {
3333
/**
3434
* Validate.
3535
*
36-
* @throws microsoft.exchange.webservices.data.exception.ServiceValidationException the service validation exception
36+
* @throws ServiceValidationException the service validation exception
3737
* @throws Exception the exception
3838
*/
3939
void validate() throws ServiceValidationException, Exception;

src/main/java/microsoft/exchange/webservices/data/autodiscover/AutodiscoverDnsClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import microsoft.exchange.webservices.data.dns.DnsClient;
2828
import microsoft.exchange.webservices.data.dns.DnsSrvRecord;
2929
import microsoft.exchange.webservices.data.enumeration.TraceFlags;
30-
import microsoft.exchange.webservices.data.exception.DnsException;
30+
import microsoft.exchange.webservices.data.core.exception.dns.DnsException;
3131

3232
import javax.xml.stream.XMLStreamException;
3333

src/main/java/microsoft/exchange/webservices/data/autodiscover/AutodiscoverService.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@
4646
import microsoft.exchange.webservices.data.enumeration.ExchangeVersion;
4747
import microsoft.exchange.webservices.data.enumeration.TraceFlags;
4848
import microsoft.exchange.webservices.data.enumeration.UserSettingName;
49-
import microsoft.exchange.webservices.data.exception.ArgumentException;
50-
import microsoft.exchange.webservices.data.exception.EWSHttpException;
51-
import microsoft.exchange.webservices.data.exception.FormatException;
52-
import microsoft.exchange.webservices.data.exception.MaximumRedirectionHopsExceededException;
53-
import microsoft.exchange.webservices.data.exception.ServiceLocalException;
54-
import microsoft.exchange.webservices.data.exception.ServiceValidationException;
55-
import microsoft.exchange.webservices.data.exception.ServiceVersionException;
49+
import microsoft.exchange.webservices.data.core.exception.misc.ArgumentException;
50+
import microsoft.exchange.webservices.data.core.exception.http.EWSHttpException;
51+
import microsoft.exchange.webservices.data.core.exception.misc.FormatException;
52+
import microsoft.exchange.webservices.data.autodiscover.exception.MaximumRedirectionHopsExceededException;
53+
import microsoft.exchange.webservices.data.core.exception.service.local.ServiceLocalException;
54+
import microsoft.exchange.webservices.data.core.exception.service.local.ServiceValidationException;
55+
import microsoft.exchange.webservices.data.core.exception.service.local.ServiceVersionException;
5656
import microsoft.exchange.webservices.data.misc.OutParam;
5757
import microsoft.exchange.webservices.data.security.XmlNodeType;
5858

@@ -373,7 +373,7 @@ private void writeLegacyAutodiscoverRequest(String emailAddress,
373373
*
374374
* @param domainName the domain name
375375
* @return A valid SSL-enabled redirection URL. (May be null)
376-
* @throws EWSHttpException the eWS http exception
376+
* @throws EWSHttpException the EWS http exception
377377
* @throws XMLStreamException the XML stream exception
378378
* @throws IOException Signals that an I/O exception has occurred.
379379
* @throws ServiceLocalException the service local exception
@@ -440,7 +440,7 @@ private URI getRedirectUrl(String domainName)
440440
* @return true if a valid redirection URL was found
441441
* @throws XMLStreamException the XML stream exception
442442
* @throws IOException signals that an I/O exception has occurred.
443-
* @throws EWSHttpException the eWS http exception
443+
* @throws EWSHttpException the EWS http exception
444444
*/
445445
private boolean tryGetRedirectionResponse(HttpWebRequest request,
446446
OutParam<URI> redirectUrl) throws XMLStreamException, IOException,
@@ -1570,7 +1570,7 @@ private boolean tryGetEnabledEndpointsForHost(String host,
15701570
*
15711571
* @param request the request
15721572
* @return Endpoints enabled.
1573-
* @throws microsoft.exchange.webservices.data.exception.EWSHttpException the eWS http exception
1573+
* @throws EWSHttpException the EWS http exception
15741574
*/
15751575
private EnumSet<AutodiscoverEndpoints> getEndpointsFromHttpWebResponse(
15761576
HttpWebRequest request) throws EWSHttpException {
@@ -1617,7 +1617,7 @@ private EnumSet<AutodiscoverEndpoints> getEndpointsFromHttpWebResponse(
16171617
* @param memoryStream the memory stream
16181618
* @throws XMLStreamException the XML stream exception
16191619
* @throws IOException signals that an I/O exception has occurred.
1620-
* @throws EWSHttpException the eWS http exception
1620+
* @throws EWSHttpException the EWS http exception
16211621
*/
16221622
public void traceResponse(HttpWebRequest request, ByteArrayOutputStream memoryStream) throws XMLStreamException,
16231623
IOException, EWSHttpException {

src/main/java/microsoft/exchange/webservices/data/autodiscover/IFuncDelegate.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
package microsoft.exchange.webservices.data.autodiscover;
2525

26-
import microsoft.exchange.webservices.data.exception.FormatException;
26+
import microsoft.exchange.webservices.data.core.exception.misc.FormatException;
2727

2828
/**
2929
* The Interface FuncDelegate.
@@ -36,7 +36,7 @@ public interface IFuncDelegate<TResult> {
3636
* Func.
3737
*
3838
* @return the t result
39-
* @throws microsoft.exchange.webservices.data.exception.FormatException the format exception
39+
* @throws FormatException the format exception
4040
*/
4141
TResult func() throws FormatException;
4242
}

src/main/java/microsoft/exchange/webservices/data/autodiscover/IFunctionDelegate.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,8 @@
2323

2424
package microsoft.exchange.webservices.data.autodiscover;
2525

26-
import microsoft.exchange.webservices.data.autodiscover.exception.AutodiscoverLocalException;
2726
import microsoft.exchange.webservices.data.enumeration.ExchangeVersion;
28-
import microsoft.exchange.webservices.data.exception.ServiceLocalException;
2927

30-
import javax.xml.stream.XMLStreamException;
31-
32-
import java.io.IOException;
3328
import java.net.URI;
3429
import java.util.List;
3530

src/main/java/microsoft/exchange/webservices/data/autodiscover/exception/AutodiscoverLocalException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
package microsoft.exchange.webservices.data.autodiscover.exception;
2525

26-
import microsoft.exchange.webservices.data.exception.ServiceLocalException;
26+
import microsoft.exchange.webservices.data.core.exception.service.local.ServiceLocalException;
2727

2828
/**
2929
* Represents an exception that is thrown when the Autodiscover service could

src/main/java/microsoft/exchange/webservices/data/autodiscover/exception/AutodiscoverRemoteException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
package microsoft.exchange.webservices.data.autodiscover.exception;
2525

2626
import microsoft.exchange.webservices.data.autodiscover.exception.error.AutodiscoverError;
27-
import microsoft.exchange.webservices.data.exception.ServiceRemoteException;
27+
import microsoft.exchange.webservices.data.core.exception.service.remote.ServiceRemoteException;
2828

2929
/**
3030
* Represents an exception that is thrown when the Autodiscover service returns

src/main/java/microsoft/exchange/webservices/data/autodiscover/exception/AutodiscoverResponseException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
package microsoft.exchange.webservices.data.autodiscover.exception;
2525

2626
import microsoft.exchange.webservices.data.autodiscover.enumeration.AutodiscoverErrorCode;
27-
import microsoft.exchange.webservices.data.exception.ServiceRemoteException;
27+
import microsoft.exchange.webservices.data.core.exception.service.remote.ServiceRemoteException;
2828

2929
/**
3030
* Represents an exception from an autodiscover error response.

src/main/java/microsoft/exchange/webservices/data/exception/MaximumRedirectionHopsExceededException.java renamed to src/main/java/microsoft/exchange/webservices/data/autodiscover/exception/MaximumRedirectionHopsExceededException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* THE SOFTWARE.
2222
*/
2323

24-
package microsoft.exchange.webservices.data.exception;
24+
package microsoft.exchange.webservices.data.autodiscover.exception;
2525

2626
import microsoft.exchange.webservices.data.autodiscover.exception.AutodiscoverLocalException;
2727

src/main/java/microsoft/exchange/webservices/data/autodiscover/request/AutodiscoverRequest.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,12 @@
3737
import microsoft.exchange.webservices.data.core.response.ServiceResponse;
3838
import microsoft.exchange.webservices.data.enumeration.TraceFlags;
3939
import microsoft.exchange.webservices.data.enumeration.XmlNamespace;
40-
import microsoft.exchange.webservices.data.exception.EWSHttpException;
41-
import microsoft.exchange.webservices.data.exception.ServiceLocalException;
42-
import microsoft.exchange.webservices.data.exception.ServiceRemoteException;
43-
import microsoft.exchange.webservices.data.exception.ServiceRequestException;
44-
import microsoft.exchange.webservices.data.exception.ServiceResponseException;
45-
import microsoft.exchange.webservices.data.exception.ServiceXmlDeserializationException;
46-
import microsoft.exchange.webservices.data.exception.ServiceXmlSerializationException;
40+
import microsoft.exchange.webservices.data.core.exception.http.EWSHttpException;
41+
import microsoft.exchange.webservices.data.core.exception.service.remote.ServiceRemoteException;
42+
import microsoft.exchange.webservices.data.core.exception.service.remote.ServiceRequestException;
43+
import microsoft.exchange.webservices.data.core.exception.service.remote.ServiceResponseException;
44+
import microsoft.exchange.webservices.data.core.exception.service.local.ServiceXmlDeserializationException;
45+
import microsoft.exchange.webservices.data.core.exception.service.local.ServiceXmlSerializationException;
4746
import microsoft.exchange.webservices.data.misc.SoapFaultDetails;
4847
import microsoft.exchange.webservices.data.security.XmlNodeType;
4948
import org.apache.commons.logging.Log;
@@ -94,7 +93,7 @@ protected AutodiscoverRequest(AutodiscoverService service, URI url) {
9493
*
9594
* @param request the request
9695
* @return True if redirection response.
97-
* @throws microsoft.exchange.webservices.data.exception.EWSHttpException the eWS http exception
96+
* @throws EWSHttpException the EWS http exception
9897
*/
9998
public static boolean isRedirectionResponse(HttpWebRequest request)
10099
throws EWSHttpException {
@@ -325,7 +324,7 @@ private void processWebException(Exception exception, HttpWebRequest req) {
325324
* @return AutodiscoverResponse autodiscoverResponse object
326325
* @throws XMLStreamException the XML stream exception
327326
* @throws IOException signals that an I/O exception has occurred
328-
* @throws EWSHttpException the eWS http exception
327+
* @throws EWSHttpException the EWS http exception
329328
*/
330329
private AutodiscoverResponse createRedirectionResponse(
331330
HttpWebRequest httpWebResponse) throws XMLStreamException,
@@ -560,7 +559,7 @@ protected void writeBodyToXml(EwsServiceXmlWriter writer)
560559
*
561560
* @param request the request
562561
* @return ResponseStream
563-
* @throws EWSHttpException the eWS http exception
562+
* @throws EWSHttpException the EWS http exception
564563
* @throws IOException signals that an I/O exception has occurred.
565564
*/
566565
protected static InputStream getResponseStream(HttpWebRequest request)

0 commit comments

Comments
 (0)