replace backslash n with <br>

This commit is contained in:
axolotle 2021-04-10 14:45:40 +02:00
parent 65f21c659a
commit a7bf1964de

View file

@ -59,7 +59,7 @@ export async function handleError (request, response, errorData) {
let errorCode = response.status in errors ? response.status : undefined let errorCode = response.status in errors ? response.status : undefined
if (typeof errorData === 'string') { if (typeof errorData === 'string') {
// FIXME API: Patching errors that are plain text or html. // FIXME API: Patching errors that are plain text or html.
errorData = { error: errorData } errorData = { error: errorData.replace('\n', '<br>') }
} }
if ('log_ref' in errorData) { if ('log_ref' in errorData) {
// Define a special error so it won't get caught as a `APIBadRequestError`. // Define a special error so it won't get caught as a `APIBadRequestError`.