Error Handling

In the event that the API returns an error, the response body will contain a error message and error code in the JSON format shown below.

We're also sending all error codes in the response header nhn-error-code. You can use this header if you're only interested in the error code to avoid parsing the response body. When error response the HTTP status will be in the range 3xx-5xx. When ok response the HTTP status will be in the 2xx range.

Example of a error response body returned from the API:

{
  "errorCode": "DHG-0009",
  "errorMessage": "An active maternity record already exists for patient. Cannot have multiple active maternity records.",
  "eventId": "c65f8f64-2c9c-4624-a4f0-3dbc4bde3300"
}

Error Codes

Authorization

For errors related to authorization go here.

Application Error Codes

Error codes has prefix "DHG".

Error code Cause
DHG-0001 Unknown technical error.
TODO TODO