Enhanced exception handling