Skip to content

Commit

Permalink
fix: incorrect statusCode of deletion
Browse files Browse the repository at this point in the history
# Problems
- Every error gets 500 status code

# Solutions
- Handle FhirWebServiceError
  • Loading branch information
Chinlinlee committed Oct 8, 2023
1 parent a1c3c59 commit 153ddb3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions api/FHIRApiService/services/delete.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ class DeleteService extends BaseFhirApiService {
try {
return await DeleteService.deleteResourceById(this.resourceType, this.resourceId);
} catch(e) {
if (e instanceof FhirWebServiceError) {
return {
status: false,
code: e.code,
result: e.operationOutcome
};
}

return {
status: false,
code: 500,
Expand Down

0 comments on commit 153ddb3

Please sign in to comment.