[Pharo-users] Problem with Mongo on Pharo5 ("collection already exists")

Holger Freyther holger at freyther.de
Wed May 25 09:49:27 EDT 2016


> On 25 May 2016, at 15:42, Esteban Lorenzano <estebanlm at gmail.com> wrote:
> 
> 

Hi,


> No I don’t… in part because is not me who make that code, but also because it is expected: after, you have: 
> 
> getCollection: aString
> 	^ [ self addCollection: aString capped: false size: nil max: nil ]
> 		on: MongoCollectionAlreadyExists 
> 		do: [ :err | 
> 			MongoCollection database: self name: aString ]
> 
> so the idea is to refine the error to separate MongoCollectionAlreadyExists so it can later be catch and handled properly. 

when adding capped collection support it seemed like a good idea to fail if a collection already exists that might not be capped, but given the follow up issues I wonder if I/we should restore the original behavior that just ignored all errors?

holger



More information about the Pharo-users mailing list