Skip to content

Commit

Permalink
catalog: propagate correctly CatalogApiException in VersionedCatalogL…
Browse files Browse the repository at this point in the history
…oader#load

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
  • Loading branch information
pierre committed Jan 22, 2016
1 parent 93f54a9 commit 3e16802
Showing 1 changed file with 7 additions and 4 deletions.
@@ -1,7 +1,9 @@
/* /*
* Copyright 2010-2013 Ning, Inc. * Copyright 2010-2013 Ning, Inc.
* Copyright 2014-2016 Groupon, Inc
* Copyright 2014-2016 The Billing Project, LLC
* *
* Ning licenses this file to you under the Apache License, version 2.0 * The Billing Project licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the * (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at: * License. You may obtain a copy of the License at:
* *
Expand Down Expand Up @@ -35,7 +37,6 @@
import org.killbill.xmlloader.UriAccessor; import org.killbill.xmlloader.UriAccessor;
import org.killbill.xmlloader.XMLLoader; import org.killbill.xmlloader.XMLLoader;


import com.google.common.io.Resources;
import com.google.inject.Inject; import com.google.inject.Inject;


public class VersionedCatalogLoader implements CatalogLoader { public class VersionedCatalogLoader implements CatalogLoader {
Expand Down Expand Up @@ -80,7 +81,7 @@ public VersionedCatalog loadDefaultCatalog(final String uriString) throws Catalo
} }
} }


public VersionedCatalog load(final List<String> catalogXMLs, final Long tenantRecordId) throws CatalogApiException { public VersionedCatalog load(final Iterable<String> catalogXMLs, final Long tenantRecordId) throws CatalogApiException {
final VersionedCatalog result = new VersionedCatalog(clock); final VersionedCatalog result = new VersionedCatalog(clock);
final URI uri; final URI uri;
try { try {
Expand All @@ -91,7 +92,9 @@ public VersionedCatalog load(final List<String> catalogXMLs, final Long tenantRe
result.add(new StandaloneCatalogWithPriceOverride(catalog, priceOverride, tenantRecordId, internalCallContextFactory)); result.add(new StandaloneCatalogWithPriceOverride(catalog, priceOverride, tenantRecordId, internalCallContextFactory));
} }
return result; return result;
} catch (Exception e) { } catch (final CatalogApiException e) {
throw e;
} catch (final Exception e) {
throw new CatalogApiException(ErrorCode.CAT_INVALID_DEFAULT, "Problem encountered loading catalog ", e); throw new CatalogApiException(ErrorCode.CAT_INVALID_DEFAULT, "Problem encountered loading catalog ", e);
} }
} }
Expand Down

0 comments on commit 3e16802

Please sign in to comment.