/**
 * Bud file for error
 * Executing this file renders locale resources.
 *
 * Generated by {{generator}} on {{today}},
 * from a template provided by {{pkg.name}}.
 *
 * @see https://github.com/coz-repo/coz
 */
"use strict";

const apeman = require('apeman'),
    apemanBudError = require('apeman-bud-error');

const $ctx = apeman.ctx(__dirname),
    colors = $ctx.colors || {},
    loc = $ctx.loc || {};

function _error(status, values) {
    let data = {};
    Object.keys(loc).forEach(lang => {
        let l = loc[lang];
        data[lang] = Object.assign({
            logo: l('logo.UI_LOGO'),
            title: `Error: ${status}`,
            caption: l(`status.${status}`)
        }, values[lang])
    });
    return data;
}

module.exports = apemanBudError({
    "404": _error(404, {}),
    "502": _error(502, {}),
    "503": _error(503, {})
}, {
    color: colors['dominant']
});

{{{read _render}}}
