Skip to content

Commit

Permalink
Revert "Revert "NN-4019: Add catch wrapper for probation docs (#2147)" (
Browse files Browse the repository at this point in the history
#2162)"

This reverts commit 55e7399.
  • Loading branch information
sp-watson authored May 26, 2022
1 parent dbb6486 commit b17b61a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
9 changes: 4 additions & 5 deletions backend/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@ import homepageController from './controllers/homepage/homepage'
import deprecatedUrlPage from './controllers/deprecatedUrlPage'
import requestLimiter from './middleware/requestLimiter'

process.on('uncaughtExceptionMonitor', (err, origin) => {
logError('UncuaghtExcMon', err, origin)
})
// We do not want the server to exit, partly because any log information will be lost.
// Instead, log the error so we can trace, diagnose and fix the problem.
process.on('uncaughtException', (err, origin) => {
logError('UncuaghtExc', err, origin)
logError('uncaughtException', err, origin)
})
process.on('unhandledRejection', (reason, promise) => {
console.log('Unhandled Rejection at: ', promise, 'reason:', reason)
logError(`unhandledRejection`, {}, `Unhandled Rejection at: ${promise} reason: ${reason}`)
})

const app = express()
Expand Down
5 changes: 4 additions & 1 deletion backend/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import appointmentConfirmDeletion from './controllers/appointmentConfirmDeletion
import appointmentDeleteRecurringBookings from './controllers/appointmentDeleteRecurringBookings'
import appointmentDeleted from './controllers/appointmentDeleted'
import { cacheFactory } from './utils/singleValueInMemoryCache'
import asyncMiddleware from './middleware/asyncHandler'

import whereaboutsRouter from './routes/whereabouts/whereaboutsRouter'

Expand Down Expand Up @@ -137,7 +138,9 @@ const setup = ({

router.get(
'/offenders/:offenderNo/probation-documents',
probationDocumentsFactory(oauthApi, prisonApi, communityApi, systemOauthClient).displayProbationDocumentsPage
asyncMiddleware(
probationDocumentsFactory(oauthApi, prisonApi, communityApi, systemOauthClient).displayProbationDocumentsPage
)
)
router.get(
'/offenders/:offenderNo/probation-documents/:documentId/download',
Expand Down

0 comments on commit b17b61a

Please sign in to comment.