We propose a catastrophic eruption model for the enormous energy release of magnetars during giant flares, in which a toroidal and helically twisted flux rope is embedded within a force-free magnetosphere. The flux rope stays in stable equilibrium states initially and evolves quasi-statically. Upon the loss of equilibrium, the flux rope cannot sustain the stable equilibrium states and erupts catastrophically. During the process, the magnetic energy stored in the magnetosphere is rapidly released as the result of destabilization of global magnetic topology. The magnetospheric energy that could be accumulated is of vital importance for the outbursts of magnetars. We carefully establish the fully open fields and partially open fields for various boundary conditions at the magnetar surface and study the relevant energy thresholds. By investigating the magnetic energy accumulated at the critical catastrophic point, we find that it is possible to drive fully open eruptions for dipole-dominated background fields. Nevertheless, it is hard to generate fully open magnetic eruptions for multipolar background fields. Given the observational importance of the multipolar magnetic fields in the vicinity of the magnetar surface, it would be worthwhile to explore the possibility of the alternative eruption approach in multipolar background fields. Fortunately, we find that flux ropes may give rise to partially open eruptions in the multipolar fields, which involve only partial opening of background fields. The energy release fractions are greater for cases with central-arcaded multipoles than those with central-caved multipoles that emerged in background fields. Eruptions would fail only when the centrally caved multipoles become extremely strong.