avoid polluting logs with long stacktraces when a request comes in for a report from an unbuilt job (a fairly common case in archive-it)

This commit is contained in:
Noah Levitt
2013-04-29 19:02:22 -07:00
parent d5693563f8
commit e531de0ed3
2 changed files with 3 additions and 2 deletions
@@ -22,7 +22,6 @@ package org.archive.crawler.restlet;
import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor;
import java.io.File;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
@@ -44,7 +43,6 @@ import org.restlet.data.Response;
import org.restlet.resource.ResourceException;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeanWrapperImpl;
import org.springframework.beans.InvalidPropertyException;
/**
* Shared superclass for resources that represent functional aspects
@@ -47,6 +47,9 @@ public class ReportGenResource extends JobRelatedResource {
public Representation represent(Variant variant) throws ResourceException {
// generate report
if (cj == null || cj.getCrawlController() == null) {
throw new ResourceException(500);
}
File f = cj.getCrawlController().getStatisticsTracker().writeReportFile(reportClass);
if (f==null) {
throw new ResourceException(500);