Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkHttpStatusCodeHandler Class Referencefinal

Utility class for handling HTTP and network error status codes from XNAT requests. More...

#include <QmitkHttpStatusCodeHandler.h>

Static Public Member Functions

static bool HandleErrorMessage (const char *_errorMsg)
 Parse an error message from an XNAT HTTP request and display a user-facing warning dialog. More...
 

Detailed Description

Utility class for handling HTTP and network error status codes from XNAT requests.

QmitkHttpStatusCodeHandler is a non-instantiable utility class that parses error messages returned by CTK XNAT HTTP requests, extracts the status code, and displays an appropriate warning message box to the user. It handles a wide range of Qt network error codes (connection errors, proxy errors, content errors, protocol errors, and server errors) as well as standard HTTP error codes.

Note
This class cannot be instantiated. All functionality is accessed through the static HandleErrorMessage method.
See also
QmitkXnatTreeModel, ctkXnatSession

Definition at line 34 of file QmitkHttpStatusCodeHandler.h.

Member Function Documentation

◆ HandleErrorMessage()

static bool QmitkHttpStatusCodeHandler::HandleErrorMessage ( const char *  _errorMsg)
static

Parse an error message from an XNAT HTTP request and display a user-facing warning dialog.

Extracts the HTTP status code and server response from the error message string, then displays an appropriate QMessageBox warning. Consecutive duplicate error codes are suppressed to avoid flooding the user with repeated dialogs.

The expected error message format is:

ERROR: ... request failed. {uuid}: <code>: Error <url> - server replied: <message>
Parameters
[in]_errorMsgThe raw error message string from the CTK XNAT runtime exception.
Returns
true if the error message was successfully parsed as an HTTP request failure, false otherwise. A general error dialog is shown for unparseable messages.

The documentation for this class was generated from the following file: