async function _transformTokenWrapper(transform, token, config, options, vol) {
  let to_ret;
  try {
    to_ret = await transform.transform(token, config, options, vol);
  } catch (e) {
    if (e instanceof Error) {
      const transformError = createErrorMessage(token, e, transform.name, !!options?.usesDtcg);
      // collect the errors so we can warn the user at the end of the run
      GroupMessages.add(TRANSFORM_ERRORS, transformError);

      // Return a sensible fallback value
      switch (transform.type) {
        case 'attribute':
          return token.attributes;
        case 'name':
          return token.name;
        case 'value':
          return options.usesDtcg ? token.$value : token.value;
      }
    }
  }
  return to_ret;
}
@param {Transform} transform
@param {Token} token
@param {PlatformConfig} config
@param {Config} options
@param {Volume} [vol]