Skip to content

Commit 62a8a42

Browse files
committed
Improved error message
1 parent c199e7d commit 62a8a42

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

phase4-dynamic-discovery/src/main/java/com/helger/phase4/dynamicdiscovery/AS4EndpointDetailProviderPeppol.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ public void init (@NonNull final IDocumentTypeIdentifier aDocTypeID,
171171
aSSM = resolvedSchemeSpecificServiceMetadata (aReceiverID, aDocTypeID);
172172
// This is just a heuristic, because it is only evaluated in logging
173173
bWildcard = aSSM != null &&
174-
PeppolIdentifierHelper.DOCUMENT_TYPE_SCHEME_PEPPOL_DOCTYPE_WILDCARD.equals (aDocTypeID.getScheme ()) &&
175-
aDocTypeID.getValue ().indexOf (PeppolIdentifierHelper.DOCUMENT_TYPE_WILDCARD_INDICATOR) >= 0;
174+
PeppolIdentifierHelper.DOCUMENT_TYPE_SCHEME_PEPPOL_DOCTYPE_WILDCARD.equals (aDocTypeID.getScheme ()) &&
175+
aDocTypeID.getValue ().indexOf (PeppolIdentifierHelper.DOCUMENT_TYPE_WILDCARD_INDICATOR) >= 0;
176176

177177
if (aSSM != null)
178178
{
@@ -193,7 +193,10 @@ public void init (@NonNull final IDocumentTypeIdentifier aDocTypeID,
193193
", " +
194194
m_aTP.getID () +
195195
")" +
196-
(bWildcard ? " [wildcard]" : " [static]"));
196+
(bWildcard ? " [wildcard]" : " [static]") +
197+
" - " +
198+
(aSSM == null ? "server error"
199+
: "failed to select endpoint from ServiceMetadata"));
197200
}
198201

199202
if (LOGGER.isDebugEnabled ())
@@ -211,9 +214,9 @@ public void init (@NonNull final IDocumentTypeIdentifier aDocTypeID,
211214
catch (final SMPClientException ex)
212215
{
213216
final boolean bRetryFeasible = ex instanceof SMPClientBadRequestException ||
214-
ex instanceof SMPClientBadResponseException ||
215-
ex instanceof SMPClientUnauthorizedException ||
216-
ex.getClass ().equals (SMPClientException.class);
217+
ex instanceof SMPClientBadResponseException ||
218+
ex instanceof SMPClientUnauthorizedException ||
219+
ex.getClass ().equals (SMPClientException.class);
217220
throw new Phase4SMPException ("Failed to resolve SMP endpoint (" +
218221
aReceiverID.getURIEncoded () +
219222
", " +

0 commit comments

Comments
 (0)