Skip to content

Commit

Permalink
Merge pull request #815 from alphagov/better-error-handling-v6
Browse files Browse the repository at this point in the history
Prevent exceptions thrown from 'compatibility mode' routes from being silently caught, disabling compatibility mode
  • Loading branch information
36degrees authored Oct 9, 2019
2 parents 2168aa2 + 75ac82e commit 6572602
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Unreleased

## Fixes

- [Pull request #815: Prevent exceptions thrown from 'compatibility mode' routes from being silently caught, disabling compatibility mode](https://github.com/alphagov/govuk-prototype-kit/pull/815)

# 9.3.0 (Feature release)

## New features
Expand Down
5 changes: 2 additions & 3 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Core dependencies
const fs = require('fs')
const path = require('path')

// NPM dependencies
Expand Down Expand Up @@ -31,11 +32,9 @@ var useV6 = false
var v6App
var v6Routes

try {
if (fs.existsSync('./app/v6/routes.js')) {
v6Routes = require('./app/v6/routes.js')
useV6 = true
} catch (e) {
// No routes.js in app/v6 so we can continue with useV6 false
}

const app = express()
Expand Down

0 comments on commit 6572602

Please sign in to comment.