DEV: Better error handling for destroy:users task (#9939)

This commit is contained in:
tshenry 2020-06-01 08:55:08 -07:00 committed by GitHub
parent 13d00eaad0
commit c01a994263
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -90,6 +90,8 @@ class DestroyTask
raise Discourse::InvalidAccess.new("User #{user.username} has #{user.post_count} posts, so can't be deleted.")
rescue NoMethodError
@io.puts "#{user.username} could not be deleted"
rescue Discourse::InvalidAccess => e
@io.puts "#{user.username} #{e.message}"
end
end
end