Changeset 5921 for ComponentRegistry


Ignore:
Timestamp:
01/16/15 09:01:12 (9 years ago)
Author:
Twan Goosen
Message:

When streaming output to the client, do not let stack trace bubble up (only log full stack trace at debug level)
Should fix #714

Location:
ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/MDMarshaller.java

    r3091 r5921  
    44import java.io.ByteArrayInputStream;
    55import java.io.ByteArrayOutputStream;
    6 import java.io.File;
    7 import java.io.FileInputStream;
    8 import java.io.IOException;
    96import java.io.InputStream;
    107import java.io.OutputStream;
  • ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/rest/ComponentRegistryRestService.java

    r5872 r5921  
    368368                                try {
    369369                                    registry.getMDComponentAsXml(componentId, output);
    370                                 } catch (ItemNotFoundException e1) {
    371                                     LOG.warn("Could not retrieve component {}",
    372                                             componentId);
    373                                     LOG.debug("Details", e1);
    374                                     throw new WebApplicationException(e1, Response
     370                                } catch (ItemNotFoundException e) {
     371                                    LOG.warn("Could not retrieve component {}: {}",
     372                                            componentId, e.getMessage());
     373                                    LOG.debug("Details", e);
     374                                    throw new WebApplicationException(Response
    375375                                            .serverError()
    376376                                            .status(Status.INTERNAL_SERVER_ERROR)
     
    378378                                }
    379379                            } catch (ComponentRegistryException e) {
    380                                 LOG.warn("Could not retrieve component {}",
    381                                         componentId);
     380                                LOG.warn("Could not retrieve component {}: {}",
     381                                        componentId, e.getMessage());
    382382                                LOG.debug("Details", e);
    383                                 throw new WebApplicationException(e, Response
     383                                throw new WebApplicationException(Response
    384384                                        .serverError()
    385385                                        .status(Status.INTERNAL_SERVER_ERROR)
     
    402402                                try {
    403403                                    registry.getMDComponentAsXsd(componentId, output);
    404                                 } catch (ItemNotFoundException e1) {
    405                                     LOG.warn("Could not retrieve component {}",
    406                                             componentId);
    407                                     LOG.debug("Details", e1);
    408                                     throw new WebApplicationException(e1, Response
     404                                } catch (ItemNotFoundException e) {
     405                                    LOG.warn("Could not retrieve component {}: {}",
     406                                            componentId, e.getMessage());
     407                                    LOG.debug("Details", e);
     408                                    throw new WebApplicationException(Response
    409409                                            .serverError()
    410410                                            .status(Status.INTERNAL_SERVER_ERROR)
     
    412412                                }
    413413                            } catch (ComponentRegistryException e) {
    414                                 LOG.warn("Could not retrieve component {}",
    415                                         componentId);
     414                                LOG.warn("Could not retrieve component {}: {}",
     415                                        componentId, e.getMessage());
    416416                                LOG.debug("Details", e);
    417                                 throw new WebApplicationException(e, Response
     417                                throw new WebApplicationException(Response
    418418                                        .serverError()
    419419                                        .status(Status.INTERNAL_SERVER_ERROR)
     
    11961196                            registry.getMDProfileAsXml(profileId, output);
    11971197                        } catch (Exception e) {
    1198                             LOG.warn("Could not retrieve component {}",
    1199                                     profileId);
     1198                            LOG.warn("Could not retrieve component {}: {}",
     1199                                    profileId, e.getMessage());
    12001200                            LOG.debug("Details", e);
    1201                             throw new WebApplicationException(e, Response
     1201                            throw new WebApplicationException(Response
    12021202                                    .serverError()
    12031203                                    .status(Status.INTERNAL_SERVER_ERROR)
     
    12141214                            registry.getMDProfileAsXsd(profileId, output);
    12151215                        } catch (Exception e) {
    1216                             LOG.warn("Could not retrieve component {}",
    1217                                     profileId);
     1216                            LOG.warn("Could not retrieve component {}: {}",
     1217                                    profileId, e.getMessage());
    12181218                            LOG.debug("Details", e);
    1219                             throw new WebApplicationException(e, Response
     1219                            throw new WebApplicationException(Response
    12201220                                    .serverError()
    12211221                                    .status(Status.INTERNAL_SERVER_ERROR)
Note: See TracChangeset for help on using the changeset viewer.