Skip to content

Commit

Permalink
Avoid overwriting disposition errors; #130
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Dec 30, 2021
1 parent 8d43ea7 commit 2a7ecb6
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,11 @@ protected void decrypt (@Nonnull final IMessage aMsg, @Nonnull final AS2Resource
LOGGER.info ("Successfully decrypted incoming AS2 message" + aMsg.getLoggingText ());
}
}
catch (final AS2DispositionException ex)
{
// Re-throw "as is"
throw ex;
}
catch (final Exception ex)
{
if (LOGGER.isErrorEnabled ())
Expand Down Expand Up @@ -326,6 +331,14 @@ protected void verify (@Nonnull final IMessage aMsg, @Nonnull final AS2ResourceH
LOGGER.info ("Successfully verified signature of incoming AS2 message" + aMsg.getLoggingText ());
}
}
catch (final AS2DispositionException ex)
{
if (LOGGER.isErrorEnabled ())
LOGGER.error ("Error verifying signature " + aMsg.getLoggingText () + ": " + ex.getMessage ());

// Re-throw "as is"
throw ex;
}
catch (final Exception ex)
{
if (LOGGER.isErrorEnabled ())
Expand Down Expand Up @@ -548,6 +561,11 @@ public void handleIncomingMessage (@Nonnull final String sClientInfo,
// Fill all partnership attributes etc.
aSession.getPartnershipFactory ().updatePartnership (aMsg, false);
}
catch (final AS2DispositionException ex)
{
// Re-throw "as is"
throw ex;
}
catch (final AS2Exception ex)
{
throw new AS2DispositionException (DispositionType.createError ("authentication-failed"),
Expand Down Expand Up @@ -621,6 +639,11 @@ public void handleIncomingMessage (@Nonnull final String sClientInfo,
{
// No module installed - ignore
}
catch (final AS2DispositionException ex)
{
// Re-throw "as is"
throw ex;
}
catch (final AS2Exception ex)
{
// Issue 90 - use CRLF as separator
Expand All @@ -640,6 +663,11 @@ public void handleIncomingMessage (@Nonnull final String sClientInfo,
{
// No module installed - ignore
}
catch (final AS2DispositionException ex)
{
// Re-throw "as is"
throw ex;
}
catch (final AS2Exception ex)
{
// Issue 90 - use CRLF as separator
Expand All @@ -659,6 +687,11 @@ public void handleIncomingMessage (@Nonnull final String sClientInfo,
{
// No module installed - ignore
}
catch (final AS2DispositionException ex)
{
// Re-throw "as is"
throw ex;
}
catch (final AS2Exception ex)
{
// Issue 90 - use CRLF as separator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ public void handle (@Nonnull final String sAction,
aMsg.attrs ().put (MessageParameters.ATTR_STORED_FILE_NAME, aMsgFile.getAbsolutePath ());
LOGGER.info ("stored message to " + aMsgFile.getAbsolutePath () + aMsg.getLoggingText ());
}
catch (final AS2DispositionException ex)
{
// Re-throw "as is"
throw ex;
}
catch (final Exception ex)
{
throw new AS2DispositionException (DispositionType.createError ("Error storing transaction"),
Expand Down

0 comments on commit 2a7ecb6

Please sign in to comment.