# Buggy code
def propagate(self, value, method=mean_motion, rtol=1e-10, **kwargs):
    """Propagates an orbit a specified time.

    If value is true anomaly, propagate orbit to this anomaly and return the result.
    Otherwise, if time is provided, propagate this `Orbit` some `time` and return the result.

    Parameters
    ----------
    value : ~astropy.units.Quantity, ~astropy.time.Time, ~astropy.time.TimeDelta
        Scalar time to propagate.
    rtol : float, optional
        Relative tolerance for the propagation algorithm, default to 1e-10.
    method : function, optional
        Method used for propagation
    **kwargs
        parameters used in perturbation models

    Returns
    -------
    Orbit
        New orbit after propagation.

    """
    if isinstance(value, time.Time) and not isinstance(value, time.TimeDelta):
        time_of_flight = value - self.epoch
    else:
        # Works for both Quantity and TimeDelta objects
        time_of_flight = time.TimeDelta(value)

    cartesian = propagate(self, time_of_flight, method=method, rtol=rtol, **kwargs)

    # If the frame supports obstime, set the time values
    kwargs = {}
    if "obstime" in self.frame.frame_attributes:
        kwargs["obstime"] = self.epoch + time_of_flight
    else:
        warn(
            "Frame {} does not support 'obstime', time values were not returned".format(
                self.frame.__class__
            )
        )

    # Use of a protected method instead of frame.realize_frame
    # because the latter does not let the user choose the representation type
    # in one line despite its parameter names, see
    # https://github.com/astropy/astropy/issues/7784
    coords = self.frame._replicate(cartesian, representation_type="cartesian", **kwargs)

    return self.from_coords(self.attractor, coords, plane=self.plane)


# Traceback (KeyError)
from poliastro.twobody import Orbit
from poliastro.bodies import Moon
from astropy import units as u
orb = Orbit.from_vectors(Moon, [-17621.48704193,   9218.72943252, -10947.19144579] * u.km, [ -6985.91793854, -13970.02807282,  -7272.34554685] * u.km / u.day)
orb
2211 x 22792 km x 36.0 deg orbit around Moon (☾) at epoch J2000.000 (TT)
orb.sample(3)
/home/juanlu/Development/poliastro/poliastro-library/src/poliastro/twobody/orbit.py:1082: UserWarning:

No frame found for attractor Moon (☾), returning only cartesian coordinates instead

<CartesianRepresentation (x, y, z) in km
[(  1738.77087758, -814.03020271,   1096.10391796),
(-17926.29064628, 8392.44675468, -11300.55584963),
(  1738.77087758, -814.03020271,   1096.10391796)]
(has differentials w.r.t.: 's')>
orb.propagate(orb.period / 2)
Traceback (most recent call last):
File "/home/juanlu/Development/poliastro/poliastro-library/src/poliastro/frames.py", line 337, in get_frame
frames = _FRAME_MAPPING[attractor]
KeyError: Moon (☾)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/juanlu/Development/poliastro/poliastro-library/src/poliastro/twobody/orbit.py", line 913, in propagate
if "obstime" in self.frame.frame_attributes:
File "/home/juanlu/Development/poliastro/poliastro-library/src/poliastro/twobody/orbit.py", line 101, in frame
self._frame = get_frame(self.attractor, self._plane, self.epoch)
File "/home/juanlu/Development/poliastro/poliastro-library/src/poliastro/frames.py", line 340, in get_frame
"Frames for orbits around custom bodies are not yet supported"
NotImplementedError: Frames for orbits around custom bodies are not yet supported

# Fixed code
def propagate(self, value, method=mean_motion, rtol=1e-10, **kwargs):
    """Propagates an orbit a specified time.

    If value is true anomaly, propagate orbit to this anomaly and return the result.
    Otherwise, if time is provided, propagate this `Orbit` some `time` and return the result.

    Parameters
    ----------
    value : ~astropy.units.Quantity, ~astropy.time.Time, ~astropy.time.TimeDelta
        Scalar time to propagate.
    rtol : float, optional
        Relative tolerance for the propagation algorithm, default to 1e-10.
    method : function, optional
        Method used for propagation
    **kwargs
        parameters used in perturbation models

    Returns
    -------
    Orbit
        New orbit after propagation.

    """
    if isinstance(value, time.Time) and not isinstance(value, time.TimeDelta):
        time_of_flight = value - self.epoch
    else:
        # Works for both Quantity and TimeDelta objects
        time_of_flight = time.TimeDelta(value)

    cartesian = propagate(self, time_of_flight, method=method, rtol=rtol, **kwargs)
    new_epoch = self.epoch + time_of_flight

    # TODO: Unify with sample
    # If the frame supports obstime, set the time values
    try:
        kwargs = {}
        if "obstime" in self.frame.frame_attributes:
            kwargs["obstime"] = new_epoch

        # Use of a protected method instead of frame.realize_frame
        # because the latter does not let the user choose the representation type
        # in one line despite its parameter names, see
        # https://github.com/astropy/astropy/issues/7784
        coords = self.frame._replicate(
            cartesian, representation_type="cartesian", **kwargs
        )

        return self.from_coords(self.attractor, coords, plane=self.plane)

    except NotImplementedError:
        return self.from_vectors(
            self.attractor,
            cartesian.xyz,
            cartesian.differentials["s"].d_xyz,
            new_epoch,
        )