# all files / keystone/lib/core/ wrapHTMLError.js

66.67% Statements 2/3
0% Branches 0/2
0% Functions 0/1
66.67% Lines 2/3

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15

    1×

    1×
     /**
     * Wraps an error in simple HTML to be sent as a response to the browser
     *
     * @api public
     */

    function wrapHTMLError (title, err) {
    	return '<html><head><meta charset=\'utf-8\'><title>Error</title>'
    	+ '<link rel=\'stylesheet\' href=\'/' + this.get('admin path') + '/styles/error.css\'>'
    	+ '</head><body><div class=\'error\'><h1 class=\'error-title\'>' + title + '</h1>'
    	+ '<div class="error-message">' + (err || '') + '</div></div></body></html>';
    }

    module.exports = wrapHTMLError;