Skip to content

Commit

Permalink
[LEVWEB-873] Fix the Start Again button
Browse files Browse the repository at this point in the history
The Start Again button on the Error page should send users back to the Audit report or the Birth Searchc page based on where they've come from.
  • Loading branch information
RobinKnipe committed Jan 26, 2018
1 parent 2d33292 commit c910689
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions middleware/error.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
'use strict';
var config = require('../config');
var logger = require('../lib/logger');
const config = require('../config');
const logger = require('../lib/logger');

module.exports = function errorMiddlewareFactory() {

/* eslint no-unused-vars: 0*/
return function errorHandler(err, req, res, next) {
var content = {};
const content = {};

err.template = 'error';
content.title = content.title || err.error || 'Error';
Expand All @@ -21,7 +21,7 @@ module.exports = function errorMiddlewareFactory() {
error: err,
content: content,
showStack: config.env === 'development',
startLink: req.path ? req.path.replace(/^\/([^\/]*).*$/, '') : ''
startLink: req.path && req.path.startsWith('/audit/user-activity') ? 'audit/user-activity' : ''
});
} else {
// Cannot render
Expand Down

0 comments on commit c910689

Please sign in to comment.