Skip to content

Commit

Permalink
bugfix to prevent (IO)Exceptions being wrapped by unhandled RuntimeEx…
Browse files Browse the repository at this point in the history
…ception
  • Loading branch information
MarkusKull committed Jul 15, 2016
1 parent b6c6e7c commit 106db37
Showing 1 changed file with 16 additions and 7 deletions.
Expand Up @@ -130,21 +130,30 @@ public void body(BodyDescriptor bd, InputStream is) throws MimeException, IOExce
decodedStream = is;
}

BodyFactory factory;
try
{
BodyFactory factory = (BodyFactory)bodyFactoryField.get(this);
body = factory.binaryBody(decodedStream);

@SuppressWarnings("unchecked")
Stack<Object> st = (Stack<Object>)stackField.get(this);
Entity entity = ((Entity) st.peek());
entity.setBody(body);
factory = (BodyFactory)bodyFactoryField.get(this);
}
catch (Exception e)
{
throw new RuntimeException(e);
}

body = factory.binaryBody(decodedStream);

@SuppressWarnings("unchecked")
Stack<Object> st;
try
{
st = (Stack<Object>)stackField.get(this);
}
catch (Exception e)
{
throw new RuntimeException(e);
}
Entity entity = ((Entity) st.peek());
entity.setBody(body);
}
}

Expand Down

0 comments on commit 106db37

Please sign in to comment.