File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 55use League \Flysystem \Util ;
66use OpenCloud \ObjectStore \Resource \Container ;
77use OpenCloud \ObjectStore \Resource \DataObject ;
8+ use OpenCloud \ObjectStore \Exception \ObjectNotFoundException ;
89use Guzzle \Http \Exception \ClientErrorResponseException ;
910
1011class Rackspace extends AbstractAdapter
@@ -163,6 +164,8 @@ public function has($path)
163164 $ object = $ this ->getObject ($ path );
164165 } catch (ClientErrorResponseException $ e ) {
165166 return false ;
167+ } catch (ObjectNotFoundException $ e ) {
168+ return false ;
166169 }
167170
168171 return $ this ->normalizeObject ($ object );
Original file line number Diff line number Diff line change @@ -49,6 +49,14 @@ public function testHasFail()
4949 $ this ->assertFalse ($ adapter ->has ('filename.ext ' ));
5050 }
5151
52+ public function testHasNotFound ()
53+ {
54+ $ container = $ this ->getContainerMock ();
55+ $ container ->shouldReceive ('getObject ' )->andThrow ('OpenCloud\ObjectStore\Exception\ObjectNotFoundException ' );
56+ $ adapter = new Rackspace ($ container );
57+ $ this ->assertFalse ($ adapter ->has ('filename.ext ' ));
58+ }
59+
5260 public function testWrite ()
5361 {
5462 $ container = $ this ->getContainerMock ();
You can’t perform that action at this time.
0 commit comments