# getCustomMessage method

String getCustomMessage(

1. dynamic messages

)

Returns a custom error message from the provided `messages` configuration.

Falls back to default messages if a custom message is not provided.

## Implementation

    String getCustomMessage(dynamic messages) {
      switch (this) {
        case LivenessCheckError.cameraPermissionDenied:
          return messages.cameraPermissionDenied;
        case LivenessCheckError.cameraInitializationFailed:
          return messages.failedToInitializeCamera;
        case LivenessCheckError.noFaceDetected:
          return messages.noFaceDetected;
        case LivenessCheckError.multipleFacesDetected:
          return messages.multipleFacesDetected;
        case LivenessCheckError.imageBlurry:
          return messages.imageTooBlurry;
        case LivenessCheckError.faceNotClear:
          return messages.holdStill;
        case LivenessCheckError.moveCloserToCamera:
          return messages.moveCloserToCamera;
        case LivenessCheckError.poorLighting:
          return messages.poorLighting;
        case LivenessCheckError.photoCaptureFailed:
          return messages.failedToCapture;
        case LivenessCheckError.processingTimeout:
          return 'Processing timeout. Please try again.';
        case LivenessCheckError.eyesClosed:
          return messages.eyesClosed;
        case LivenessCheckError.unknownError:
          return 'An unknown error occurred';
      }
    }