mirror of
https://github.com/Alfresco/alfresco-transform-core.git
synced 2025-08-14 17:58:27 +00:00
Save point: [skip ci]
* Tika test
This commit is contained in:
@@ -87,13 +87,13 @@ abstract class TransformProcess extends TransformStreamHandler
|
|||||||
}
|
}
|
||||||
catch (TransformException e)
|
catch (TransformException e)
|
||||||
{
|
{
|
||||||
transformerDebug.logFailure(reference, e.getMessage());
|
transformerDebug.logFailure(reference, " Error: "+e.getMessage());
|
||||||
LogEntry.setStatusCodeAndMessage(e.getStatus(), e.getMessage());
|
LogEntry.setStatusCodeAndMessage(e.getStatus(), e.getMessage());
|
||||||
handleTransformException(e, e.getStatus());
|
handleTransformException(e, e.getStatus());
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
transformerDebug.logFailure(reference, e.getMessage());
|
transformerDebug.logFailure(reference, " Error: "+e.getMessage());
|
||||||
LogEntry.setStatusCodeAndMessage(INTERNAL_SERVER_ERROR, e.getMessage());
|
LogEntry.setStatusCodeAndMessage(INTERNAL_SERVER_ERROR, e.getMessage());
|
||||||
handleException(e);
|
handleException(e);
|
||||||
}
|
}
|
||||||
@@ -134,6 +134,6 @@ abstract class TransformProcess extends TransformStreamHandler
|
|||||||
|
|
||||||
protected void handleException(Exception e)
|
protected void handleException(Exception e)
|
||||||
{
|
{
|
||||||
throw new RuntimeException(e);
|
throw new TransformException(INTERNAL_SERVER_ERROR, e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -236,7 +236,7 @@ public class Tika
|
|||||||
}
|
}
|
||||||
catch (UnsupportedEncodingException e)
|
catch (UnsupportedEncodingException e)
|
||||||
{
|
{
|
||||||
throw new IllegalStateException("Unsupported encoding "+e.getMessage(), e);
|
throw new IllegalArgumentException("Unsupported encoding "+e.getMessage(), e);
|
||||||
}
|
}
|
||||||
catch (SAXException | TikaException | IOException e)
|
catch (SAXException | TikaException | IOException e)
|
||||||
{
|
{
|
||||||
|
@@ -245,10 +245,6 @@ public class TikaTest extends AbstractBaseTest
|
|||||||
{
|
{
|
||||||
mockTransformCommand(PDF, TXT, MIMETYPE_PDF, true);
|
mockTransformCommand(PDF, TXT, MIMETYPE_PDF, true);
|
||||||
targetEncoding = "rubbish";
|
targetEncoding = "rubbish";
|
||||||
// mockMvc.perform(
|
|
||||||
// mockMvcRequest(ENDPOINT_TRANSFORM, sourceFile, "targetExtension", targetExtension))
|
|
||||||
// .andExpect(MockMvcResultMatchers.status().is(INTERNAL_SERVER_ERROR.value()));
|
|
||||||
|
|
||||||
mockMvc.perform(
|
mockMvc.perform(
|
||||||
mockMvcRequest(ENDPOINT_TRANSFORM, sourceFile, "targetExtension", targetExtension))
|
mockMvcRequest(ENDPOINT_TRANSFORM, sourceFile, "targetExtension", targetExtension))
|
||||||
.andExpect(status().is(INTERNAL_SERVER_ERROR.value()));
|
.andExpect(status().is(INTERNAL_SERVER_ERROR.value()));
|
||||||
|
Reference in New Issue
Block a user