/**
 * Define a request method to serve something wrong pages.
 * @function serverside.res.defineResSomethingWrong
 * @param {object} context - Server context object.
 * @param {string} context.DEFAULT_LANG - Default lang.
 * @param {string} context.SUPPORTED_LANGS - Supported langs.
 * @param {number} context.SOMETHING_WRONG_STATUS_CODE - Status code.
 * @returns {function} - Res somethingWrong function.
 * @author Taka Okunishi
 *
 */

var _getLocaledFilenamesFromContext = require('./_get_localed_filenames_from_context');

exports = module.exports = function (context) {
    context.assertKeys(['SOMETHING_WRONG_STATUS_CODE', 'DEFAULT_LANG', 'SUPPORTED_LANGS']);

    return exports._defineHtmlSendFunction({
        statusCode: context.SOMETHING_WRONG_STATUS_CODE,
        defaultLang: context.DEFAULT_LANG,
        filenames: _getLocaledFilenamesFromContext(
            context, '%s_SOMETHING_WRONG_HTML_PATH'
        )
    });
};

exports._defineHtmlSendFunction = require('./_define_html_send_function');