mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-09-25 15:16:24 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user