Skip to content

Commit

Permalink
Add better error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
elsaperelli committed Jun 20, 2024
1 parent 4e625e1 commit 70bfca1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/services/bulkstatus.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ async function checkBulkStatus(req, res) {
severity: 'fatal',
code: 'transient',
details: {
text: "Internal System Error: '$import' request not processed."
text: bulkStatus.error.message ?? "Internal System Error: '$import' request not processed."

Check warning on line 77 in src/services/bulkstatus.service.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
}
}
]
Expand Down
4 changes: 2 additions & 2 deletions src/services/import.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ const logger = require('../server/logger');
*/
async function bulkImport(req, res) {
logger.info('Base >>> Import');
logger.debug(`Request headers: ${JSON.stringify(req.header)}`);
logger.debug(`Request headers: ${JSON.stringify(req.headers)}`);
logger.debug(`Request body: ${JSON.stringify(req.body)}`);
logger.debug(`Request params: ${JSON.stringify(req.params)}`);

checkContentTypeHeader(req.header);
checkContentTypeHeader(req.headers);

// ID assigned to the requesting client
const clientEntry = await addPendingBulkImportRequest(req.body);
Expand Down
2 changes: 1 addition & 1 deletion src/util/errorUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { ServerError } = require('@projecttacoma/node-fhir-server-core');
*/
class CustomServerError extends ServerError {
constructor(message, customStatusCode, customCode) {
super(null, {
super(message, {
statusCode: customStatusCode,
issue: [
{
Expand Down

0 comments on commit 70bfca1

Please sign in to comment.