1 | /**
|
2 | * Bud file for error
|
3 | * Executing this file renders locale resources.
|
4 | *
|
5 | * Generated by {{generator}} on {{today}},
|
6 | * from a template provided by {{ pkg.name }}.
|
7 | *
|
8 | * @see https://github.com/coz-repo/coz
|
9 | */
|
10 | 'use strict'
|
11 |
|
12 | const apeman = require('apeman')
|
13 | const apemanBudError = require('apeman-bud-error')
|
14 |
|
15 | const $ctx = apeman.ctx(__dirname)
|
16 | const colors = $ctx.colors || {}
|
17 | const loc = $ctx.loc || {}
|
18 |
|
19 | function _error (status, values) {
|
20 | let data = {}
|
21 | Object.keys(loc).forEach((lang) => {
|
22 | let l = loc[lang]
|
23 | data[lang] = Object.assign({
|
24 | logo: l('logo.UI_LOGO'),
|
25 | title: `Error: ${status}`,
|
26 | caption: l(`status.${status}`)
|
27 | }, values[ lang ])
|
28 | })
|
29 | return data;
|
30 | }
|
31 |
|
32 | module.exports = apemanBudError({
|
33 | "404": _error(404, {}),
|
34 | "502": _error(502, {}),
|
35 | "503": _error(503, {})
|
36 | }, {
|
37 | color: colors[ 'dominant' ]
|
38 | })
|
39 |
|
40 | {{{read _render}}}
|
41 |
|
\ | No newline at end of file |