diff --git a/epivar-prod/docker-compose.yml b/epivar-prod/docker-compose.yml index e5a7cbb3..81500023 100644 --- a/epivar-prod/docker-compose.yml +++ b/epivar-prod/docker-compose.yml @@ -2,7 +2,7 @@ services: # Common ------------------------------------------------------------------------------------------------------------- epivar-portal: - image: ghcr.io/c3g/epivar-portal:pr-15 + image: ghcr.io/c3g/epivar-portal:edge ports: - 80:80 depends_on: @@ -18,7 +18,7 @@ services: # Node 1: hg19 data -------------------------------------------------------------------------------------------------- epivar-node-1-server: - image: ghcr.io/c3g/epivar-server:pr-15 + image: ghcr.io/c3g/epivar-server:edge networks: - epivar-node-1-server-net - epivar-node-1-redis-net @@ -79,7 +79,7 @@ services: # Node 2: hg38 data (lifted over) ------------------------------------------------------------------------------------ epivar-node-2-server: - image: ghcr.io/c3g/epivar-server:pr-15 + image: ghcr.io/c3g/epivar-server:edge networks: - epivar-node-2-server-net - epivar-node-2-redis-net diff --git a/helpers/handlers.mjs b/helpers/handlers.mjs index 5706b413..6541627b 100644 --- a/helpers/handlers.mjs +++ b/helpers/handlers.mjs @@ -3,15 +3,27 @@ */ +const GENERIC_MESSAGE = + "An error was encountered while processing this request. See the server logs for more information."; + export const errorHandler = (res, status=500) => err => { if (status) { res.status(status); } if (err instanceof Error) { - res.json({ok: false, status, message: err.toString(), stack: err.stack.split('\n')}); + let message = err.toString(); + console.error(`Error encountered (status=${status}): ${message}; stack:\n`, err.stack); + if (message.startsWith("Error: Command failed:")) { + message = GENERIC_MESSAGE; + } + res.json({ok: false, status, message}); } else { - res.json({ok: false, status, message: err}); + let message = err; + if (message.startsWith("Error: Command failed:")) { + message = GENERIC_MESSAGE; + } + res.json({ok: false, status, message}); } res.end(); };