diff --git a/source/Superluminal-RESTfulAPI/ExpiringResource.class.st b/source/Superluminal-RESTfulAPI/ExpiringResource.class.st index 4027e13..f860bb0 100644 --- a/source/Superluminal-RESTfulAPI/ExpiringResource.class.st +++ b/source/Superluminal-RESTfulAPI/ExpiringResource.class.st @@ -104,7 +104,7 @@ ExpiringResource >> withExpirationDo: ifPresentBlock ifNone: noneBlock [ ^ [ ifPresentBlock value: ( self expirationDateApplyingCacheControlDirectivesIfNone: [ self expires ] ) ] - on: NotFound , SubscriptOutOfBounds + on: NotFound , SubscriptOutOfBounds , CollectionIsEmpty do: [ :ex | ex return: noneBlock value ] ] diff --git a/source/Superluminal-RESTfulAPI/RESTfulAPIClient.class.st b/source/Superluminal-RESTfulAPI/RESTfulAPIClient.class.st index 27fd4c5..c297fef 100644 --- a/source/Superluminal-RESTfulAPI/RESTfulAPIClient.class.st +++ b/source/Superluminal-RESTfulAPI/RESTfulAPIClient.class.st @@ -268,13 +268,13 @@ RESTfulAPIClient >> postAt: aLocation configuredBy: aRequestBuildingBlock withSu { #category : 'private - inkoving' } RESTfulAPIClient >> processPutResponse: response at: aLocation whenSuccessfulDo: aBlock [ - response isSuccess - then: [ - expiringCache clearResourceAt: aLocation. - ^ response isNoContent - then: [ response ] - otherwise: [ aBlock value: ( self tryToCacheContentsOf: response basedOn: aLocation ) ] - ]. + response isSuccess then: [ + expiringCache clearResourceAt: aLocation. + [ + aBlock value: + (self tryToCacheContentsOf: response basedOn: aLocation) ] unless: + response isNoContent. + ^ response ]. ^ self signalCannotCompleteUpdateErrorBasedOn: response ]