feat(errors): new error page copy

This commit is contained in:
Benedikt Rötsch
2018-02-14 16:15:32 +01:00
committed by Benedikt Rötsch
parent 3c9089af98
commit 5e55d7b5b4
5 changed files with 47 additions and 47 deletions

View File

@@ -57,7 +57,7 @@ module.exports.getCourse = async (request, response, next) => {
course = await getCourse(request.params.slug, response.locals.currentLocale.code, response.locals.currentApi.id)
} catch (err) {
if (err.status === 404) {
err.message = translate('error404Course', response.currentLocale)
err.message = translate('errorMessage404Course', response.currentLocale)
}
throw err
}
@@ -98,7 +98,7 @@ module.exports.getCoursesByCategory = async (request, response, next) => {
const activeCategory = categories.find((category) => category.fields.slug === request.params.category)
if (!activeCategory) {
const error = new Error(translate('error404Category', response.currentLocale))
const error = new Error(translate('errorMessage404Category', response.currentLocale))
error.status = 404
throw error
}
@@ -128,7 +128,7 @@ module.exports.getLesson = async (request, response, next) => {
let {lesson, nextLesson} = getNextLesson(lessons, request.params.lslug)
if (!lesson) {
const error = new Error(translate('error404Lesson', response.currentLocale))
const error = new Error(translate('errorMessage404Lesson', response.currentLocale))
error.status = 404
throw error
}