object_type decode()

in include/spotify/json/codec/empty_as.hpp [49:63]


  object_type decode(decode_context &context) const {
    const auto original_position = context.position;
    try {
      return _inner_codec.decode(context);
    } catch (const decode_exception &exception) {
      try {
        context.position = original_position;
        return _empty_codec.decode(context);
      } catch (const decode_exception &) {
        // The error of the inner codec is more interesting than saying, for
        // example, that the object is not a valid null.
        throw exception;
      }
    }
  }