Skip to content

Commit

Permalink
tidied exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
andytaylor committed Dec 3, 2009
1 parent 653212d commit 60da95b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -549,14 +549,13 @@ public void handleDeleteQueue(final SessionDeleteQueueMessage packet)
}
catch (Exception e)
{
log.error("Failed to delete queue", e);

if (e instanceof HornetQException)
{
response = new HornetQExceptionMessage((HornetQException)e);
}
else
{
log.error("Failed to delete queue", e);
response = new HornetQExceptionMessage(new HornetQException(HornetQException.INTERNAL_ERROR));
}
}
Expand Down Expand Up @@ -604,14 +603,14 @@ else if (name.equals(managementAddress))
}
catch (Exception e)
{
log.error("Failed to execute queue query", e);

if (e instanceof HornetQException)
{
response = new HornetQExceptionMessage((HornetQException)e);
}
else
{
log.error("Failed to execute queue query", e);

response = new HornetQExceptionMessage(new HornetQException(HornetQException.INTERNAL_ERROR));
}
}
Expand Down Expand Up @@ -1552,8 +1551,6 @@ public void handleSendContinuations(final SessionSendContinuationMessage packet)
}
catch (Exception e)
{
log.error("Failed to send message", e);

if (packet.isRequiresResponse())
{
if (e instanceof HornetQException)
Expand All @@ -1562,6 +1559,8 @@ public void handleSendContinuations(final SessionSendContinuationMessage packet)
}
else
{
log.error("Failed to send message", e);

response = new HornetQExceptionMessage(new HornetQException(HornetQException.INTERNAL_ERROR));
}
}
Expand Down

0 comments on commit 60da95b

Please sign in to comment.