From ef204118f8acd92360de47c8fe95b3fd35728401 Mon Sep 17 00:00:00 2001 From: Alan Cruikshanks Date: Fri, 16 Dec 2022 16:09:14 +0000 Subject: [PATCH] Fix issue with error-pages.plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In [Add Create Sroc Bill Run endpoint](https://github.com/DEFRA/water-abstraction-system/pull/51) we realised the `error-pages.plugin.js` had been written with the assumption we would always want to return a HTML response. But we're now building API only endpoints for use by the other apps in the service. For this we just want the standard response to be returned. So, we made a tweak and added additional options to the routes of our API only endpoints that allow us to set whether error-pages should use 'plain output' (no HTML). Only, we've inadvertently broken things for routes that don't have that additional option set! 🤦 This change adds some tests in the hope we catch this sooner in future. It also fixes the issue.