package org.deeplearning4j.ui.exception;


import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;


@Provider
public class GenericExceptionMapper implements ExceptionMapper<Throwable> {

    @Override
    public Response toResponse(Throwable ex) {
        return Response.status(500)
                .entity("Error occurred")
                .type(MediaType.APPLICATION_JSON)
                .build();
    }

}
@@ -179,16 +179,74 @@
 vider;%0A%0A
+import org.apache.commons.lang.exception.ExceptionUtils;%0A%0A
 %0A@Provid
@@ -461,17 +461,76 @@
 occurred
-%22
+%5Cn%5Cn%22 + (ex != null ? ExceptionUtils.getStackTrace(ex) : %22%22)
 )%0A      

Print exception details for UI