- All exceptions thrown in the dicom-server code inherit from base type DicomServerException.
- All user input validation errors throw a derived exception from ValidationException.
- Internal classes use Ensure library to validate input. Ensure library throws .Net Argument*Exception.
- Exceptions from dependent libraries like fo-dicom are caught and wrapped in exception inherited from DicomServerException.
- Exceptions from dependent services libraries like Azure storage blob are caught and wrapped in exception inherited from DicomServerException.
- All DicomServerExceptions are handled in middleware ExceptionHandlingMiddleware. These exceptions are mapped to the right status code and response body.
- All unexpected exceptions are logged and mapped to 500 server error.