Fixing error where container failure is ignored.

This commit is contained in:
Matt Butcher 2012-03-15 11:06:42 -05:00
parent 394337318a
commit ce8aa406d2
2 changed files with 11 additions and 7 deletions

View File

@ -781,7 +781,7 @@ class Container implements \Countable, \IteratorAggregate {
* @deprecated * @deprecated
*/ */
public function remoteObject($name) { public function remoteObject($name) {
$this->proxyObject($name); return $this->proxyObject($name);
} }
/** /**

View File

@ -844,13 +844,19 @@ class StreamWrapper {
} }
// End EXPERIMENTAL section. // End EXPERIMENTAL section.
// Now we need to get the container. Doing a server round-trip here gives
// us the peace of mind that we have an actual container.
// XXX: Should we make it possible to get a container blindly, without the
// server roundtrip?
try { try {
// Now we need to get the container. Doing a server round-trip here gives
// us the peace of mind that we have an actual container.
// XXX: Should we make it possible to get a container blindly, without the
// server roundtrip?
$this->container = $this->store->container($containerName); $this->container = $this->store->container($containerName);
}
catch (\HPCloud\Transport\FileNotFoundException $e) {
trigger_error('Container not found.', E_USER_WARNING);
return FALSE;
}
try{
// Now we fetch the file. Only under certain circumstances do we generate // Now we fetch the file. Only under certain circumstances do we generate
// an error if the file is not found. // an error if the file is not found.
// FIXME: We should probably allow a context param that can be set to // FIXME: We should probably allow a context param that can be set to
@ -1239,8 +1245,6 @@ class StreamWrapper {
* the cached stat['size'] for the underlying buffer. * the cached stat['size'] for the underlying buffer.
*/ */
protected function generateStat($object, $container, $size) { protected function generateStat($object, $container, $size) {
// This is not entirely accurate. Basically, if the // This is not entirely accurate. Basically, if the
// file is marked public, it gets 100775, and if // file is marked public, it gets 100775, and if
// it is private, it gets 100770. // it is private, it gets 100770.