Catch sort() exception