function createHandleSignupError(res) {
  /**
   * Log error to Sentry and redirect to error page
   *
   * @param {Number} errorCode
   * @param {Any} errorAddtlInfo
   */
  return (errorCode = 0, errorAddtlInfo = false) => {
    captureSentry(
      getInternalError(errorCode),
      'handleSignupCallback',
      {
        extra: errorAddtlInfo,
      },
    );

    // @todo Make this a util getter/setter
    let errorQuery;
    switch (errorCode) {
      case 50:
        errorQuery = { type: 2, id: errorAddtlInfo.id || 0 };
        break;

      default:
        errorQuery = { type: 1 };
    }

    res.redirect(303, `/error?${stringify(errorQuery)}`);
  };
}
/**
 * Factory for handling error while creating athlete in db
 *
 * @param {Response}
 * @return {Function}
 */
Factory for handling error while creating athlete in db
@param {Response}
@return {Function}
Factory for handling error while creating athlete in db @param { Response } @return { Function }
function createHandleSignupError(res) {
  return (errorCode = 0, errorAddtlInfo = false) => {
    captureSentry(
      getInternalError(errorCode),
      'handleSignupCallback',
      {
        extra: errorAddtlInfo,
      },
    );
    let errorQuery;
    switch (errorCode) {
      case 50:
        errorQuery = { type: 2, id: errorAddtlInfo.id || 0 };
        break;
      default:
        errorQuery = { type: 1 };
    }
    res.redirect(303, `/error?${stringify(errorQuery)}`);
  };
}
function createHandleSignupError ( res ) { return ( errorCode = 0 , errorAddtlInfo = false ) => { captureSentry ( getInternalError ( errorCode ) , 'handleSignupCallback' , { extra : errorAddtlInfo , } , ) ; let errorQuery ; switch ( errorCode ) { case 50 : errorQuery = { type : 2 , id : errorAddtlInfo . id || 0 } ; break ; default : errorQuery = { type : 1 } ; } res . redirect ( 303 , ` ${ stringify ( errorQuery ) } ` ) ; } ; }
Factory for handling error while creating athlete in db
 @param {Response}
 @return {Function}
Factory for handling error while creating athlete in db @param { Response } @return { Function }
/**
   * Log error to Sentry and redirect to error page
   *
   * @param {Number} errorCode
   * @param {Any} errorAddtlInfo
   */ // @todo Make this a util getter/setter