You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shindig.apache.org by dd...@apache.org on 2012/08/07 20:32:57 UTC
svn commit: r1370424 - in /shindig/trunk/java:
common/src/main/resources/org/apache/shindig/common/logging/i18n/
gadgets/src/main/java/org/apache/shindig/gadgets/
Author: ddumont
Date: Tue Aug 7 18:32:57 2012
New Revision: 1370424
URL: http://svn.apache.org/viewvc?rev=1370424&view=rev
Log:
SHINDIG-1832 - Absence of an error code in case of wrong gadget URL
For Marshall Shi
Modified:
shindig/trunk/java/common/src/main/resources/org/apache/shindig/common/logging/i18n/resource.properties
shindig/trunk/java/common/src/main/resources/org/apache/shindig/common/logging/i18n/resource_en_US.properties
shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/AbstractSpecFactory.java
Modified: shindig/trunk/java/common/src/main/resources/org/apache/shindig/common/logging/i18n/resource.properties
URL: http://svn.apache.org/viewvc/shindig/trunk/java/common/src/main/resources/org/apache/shindig/common/logging/i18n/resource.properties?rev=1370424&r1=1370423&r2=1370424&view=diff
==============================================================================
--- shindig/trunk/java/common/src/main/resources/org/apache/shindig/common/logging/i18n/resource.properties (original)
+++ shindig/trunk/java/common/src/main/resources/org/apache/shindig/common/logging/i18n/resource.properties Tue Aug 7 18:32:57 2012
@@ -162,8 +162,8 @@ elFailure=The following EL error occurre
skipIllegalHeader=The {0} header is illegal and is being skipped. The following error occurred: {1}.
##AbstractSpecFactory
-updateSpecFailureUseCacheVersion=An error occurred when updating {0}. A cached version is being used instead.
-updateSpecFailureApplyNegCache=An error occurred when updating {0}. A negative cache is being applied.
+updateSpecFailureUseCacheVersion=An error occurred when updating {0}. Status code {1} was returned. Exception: {2}. A cached version is being used instead.
+updateSpecFailureApplyNegCache=An error occurred when updating {0}. Status code {1} was returned. Exception: {2}. A negative cache is being applied.
##HashLockedDomainService
noLockedDomainConfig=A locked domain configuration for {0} does not exist.
Modified: shindig/trunk/java/common/src/main/resources/org/apache/shindig/common/logging/i18n/resource_en_US.properties
URL: http://svn.apache.org/viewvc/shindig/trunk/java/common/src/main/resources/org/apache/shindig/common/logging/i18n/resource_en_US.properties?rev=1370424&r1=1370423&r2=1370424&view=diff
==============================================================================
--- shindig/trunk/java/common/src/main/resources/org/apache/shindig/common/logging/i18n/resource_en_US.properties (original)
+++ shindig/trunk/java/common/src/main/resources/org/apache/shindig/common/logging/i18n/resource_en_US.properties Tue Aug 7 18:32:57 2012
@@ -162,8 +162,8 @@ elFailure=The following EL error occurre
skipIllegalHeader=The {0} header is illegal and is being skipped. The following error occurred: {1}.
##AbstractSpecFactory
-updateSpecFailureUseCacheVersion=An error occurred when updating {0}. A cached version is being used instead.
-updateSpecFailureApplyNegCache=An error occurred when updating {0}. A negative cache is being applied.
+updateSpecFailureUseCacheVersion=An error occurred when updating {0}. Status code {1} was returned. Exception: {2}. A cached version is being used instead.
+updateSpecFailureApplyNegCache=An error occurred when updating {0}. Status code {1} was returned. Exception: {2}. A negative cache is being applied.
##HashLockedDomainService
noLockedDomainConfig=A locked domain configuration for {0} does not exist.
Modified: shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/AbstractSpecFactory.java
URL: http://svn.apache.org/viewvc/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/AbstractSpecFactory.java?rev=1370424&r1=1370423&r2=1370424&view=diff
==============================================================================
--- shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/AbstractSpecFactory.java (original)
+++ shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/AbstractSpecFactory.java Tue Aug 7 18:32:57 2012
@@ -217,18 +217,30 @@ public abstract class AbstractSpecFactor
T newSpec = fetchFromNetwork(query);
cache.addElement(query.specUri.toString(), newSpec, refresh);
} catch (SpecRetrievalFailedException se) {
- if (LOG.isLoggable(Level.INFO)) {
- LOG.logp(Level.INFO, classname, "SpecUpdater", MessageKeys.UPDATE_SPEC_FAILURE_APPLY_NEG_CACHE, new Object[] {query.specUri});
+ if (LOG.isLoggable(Level.WARNING)) {
+ LOG.logp(Level.WARNING, classname, "SpecUpdater", MessageKeys.UPDATE_SPEC_FAILURE_APPLY_NEG_CACHE, new Object[] {
+ query.specUri,
+ se.getHttpStatusCode(),
+ se.getMessage()
+ });
}
} catch (GadgetException e) {
if (old != null) {
- if (LOG.isLoggable(Level.INFO)) {
- LOG.logp(Level.INFO, classname, "SpecUpdater", MessageKeys.UPDATE_SPEC_FAILURE_USE_CACHE_VERSION, new Object[] {query.specUri});
+ if (LOG.isLoggable(Level.WARNING)) {
+ LOG.logp(Level.WARNING, classname, "SpecUpdater", MessageKeys.UPDATE_SPEC_FAILURE_USE_CACHE_VERSION, new Object[] {
+ query.specUri,
+ e.getHttpStatusCode(),
+ e.getMessage()
+ });
}
cache.addElement(query.specUri.toString(), old, refresh);
} else {
- if (LOG.isLoggable(Level.INFO)) {
- LOG.logp(Level.INFO, classname, "SpecUpdater", MessageKeys.UPDATE_SPEC_FAILURE_APPLY_NEG_CACHE, new Object[] {query.specUri});
+ if (LOG.isLoggable(Level.WARNING)) {
+ LOG.logp(Level.WARNING, classname, "SpecUpdater", MessageKeys.UPDATE_SPEC_FAILURE_APPLY_NEG_CACHE, new Object[] {
+ query.specUri,
+ e.getHttpStatusCode(),
+ e.getMessage()
+ });
}
cache.addElement(query.specUri.toString(), e, refresh);
}