Source:
<code>private void findResourceLocationAndInstall(Resource r, Vector<Reference> invalid, boolean upgrade, CommCarePlatform platform, ResourceTable master, boolean recovery) throws UnresolvedResourceException, UnfullfilledRequirementsException, InstallCancelledException { UnreliableSourceException unreliableSourceException = null; InvalidResourceException invalidResourceException = null; UnresolvedResourceException unresolvedResourceException = null; boolean handled = false; for (ResourceLocation location : r.getLocations()) { if (handled) { break; } if (recovery && location.getAuthority() == Resource.RESOURCE_AUTHORITY_LOCAL) { continue; } if (location.isRelative()) { for (Reference ref : gatherLocationsRefs(location, r, this, master)) { if (!(location.getAuthority() == Resource.RESOURCE_AUTHORITY_LOCAL && invalid.contains(ref))) { try { handled = installResource(r, location, ref, this, platform, upgrade, recovery); } catch (InvalidResourceException e) { invalidResourceException = e; } catch (UnreliableSourceException use) { unreliableSourceException = use; } if (handled) { recordSuccess(r); break; } } } } else { try { handled = installResource(r, location, ReferenceManager.instance().DeriveReference(location.getLocation()), this, platform, upgrade, recovery); if (handled) { recordSuccess(r); break; } } catch (InvalidResourceException e) { invalidResourceException = e; } catch (InvalidReferenceException ire) { ire.printStackTrace(); } catch (UnreliableSourceException use) { unreliableSourceException = use; <START> } catch (UnresolvedResourceException ure) { <END> unresolvedResourceException = ure; } } } if (!handled) { if (invalidResourceException != null) { throw invalidResourceException; } else if (unresolvedResourceException != null) { throw unresolvedResourceException; } else if (unreliableSourceException == null) { throw new UnresolvedResourceException(r, "No external or local definition could be found for resource " + r.getResourceId()); } else { throw unreliableSourceException; } } }</code><technical_language>Note: I changes this call stack generally replicated line 390</technical_language>

Target:
private void findResourceLocationAndInstall(Resource r, Vector<Reference> invalid, boolean upgrade, CommCarePlatform platform, ResourceTable master, boolean recovery) throws UnresolvedResourceException, UnfullfilledRequirementsException, InstallCancelledException { UnreliableSourceException unreliableSourceException = null; InvalidResourceException invalidResourceException = null; UnresolvedResourceException unresolvedResourceException = null; boolean handled = false; for (ResourceLocation location : r.getLocations()) { if (handled) { break; } if (recovery && location.getAuthority() == Resource.RESOURCE_AUTHORITY_LOCAL) { continue; } if (location.isRelative()) { for (Reference ref : gatherLocationsRefs(location, r, this, master)) { if (!(location.getAuthority() == Resource.RESOURCE_AUTHORITY_LOCAL && invalid.contains(ref))) { try { handled = installResource(r, location, ref, this, platform, upgrade, recovery); } catch (InvalidResourceException e) { invalidResourceException = e; } catch (UnreliableSourceException use) { unreliableSourceException = use; } catch (UnresolvedResourceException ure) { unresolvedResourceException = ure; } if (handled) { recordSuccess(r); break; } } } } else { try { handled = installResource(r, location, ReferenceManager.instance().DeriveReference(location.getLocation()), this, platform, upgrade, recovery); if (handled) { recordSuccess(r); break; } } catch (InvalidResourceException e) { invalidResourceException = e; } catch (InvalidReferenceException ire) { ire.printStackTrace(); } catch (UnreliableSourceException use) { unreliableSourceException = use; } catch (UnresolvedResourceException ure) { unresolvedResourceException = ure; } } } if (!handled) { if (invalidResourceException != null) { throw invalidResourceException; } else if (unresolvedResourceException != null) { throw unresolvedResourceException; } else if (unreliableSourceException == null) { throw new UnresolvedResourceException(r, "No external or local definition could be found for resource " + r.getDescriptor() + " with id " + r.getResourceId()); } else { throw unreliableSourceException; } } }