On Wed, Jun 29, 2011 at 7:49 PM, Jarrod Roberson <[email protected]>wrote:
> On Wednesday, June 29, 2011 1:31:14 PM UTC-4, Jarrod Roberson wrote: >> >> This is the errors from the log for when I try and delete this repository >> >> ActiveRecord::RecordInvalid (Validation failed: Name has already been >> taken): >> > > Apparently the repository that I was trying to delete had a clone of it, > once that clone was deleted I was able to delete it. > > This should be a very friendly message like "This repository has clones of > it you can't delete it until they are deleted" > > or some such wording instead of the default "oh crap something happened" > message and the obtuse log entry. > Jarrod, Any unexpected/unhandled errors are resuced/caught by the fallback handlers defined in application_controller.rb; any errors not handled this way will throw a 500. In this specific case, a ActiveRecord::RecordInvalid is thrown in RepositoriesController#destroy - which indicates the case you're describing is not something dealt with gracefully by Gitorious. To me this case - that a repository cannot be removed because it has clones - should absolutely be handled more gracefully: - either by checking if it can be deleted in the destroy method in RepositoriesController - or even better by not displaying the delete button (replace it with a description instead) if the repository cannot be removed. Christian has been working on a feature which lets a user promote a clone of a repository he started to be the new canonical version of a repository - this would be a reasonable alternative to offer users who want to remove a repository that cannot be removed without creating inconsistencies in the database. Just telling the user a repository can't be removed will not really help him/her achieve what he wants. - Marius -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected]
