getMessage static method

String getMessage(
  1. int code
)

Get human-readable message for an error code

Implementation

static String getMessage(int code) {
  switch (code) {
    case success:
      return 'Success';
    case errorNotInitialized:
      return 'Not initialized';
    case errorAlreadyInitialized:
      return 'Already initialized';
    case errorInitializationFailed:
      return 'Initialization failed';
    case errorInvalidConfiguration:
      return 'Invalid configuration';
    case errorModelNotFound:
      return 'Model not found';
    case errorModelLoadFailed:
      return 'Model load failed';
    case errorModelNotLoaded:
      return 'Model not loaded';
    case errorGenerationFailed:
      return 'Generation failed';
    case errorInferenceFailed:
      return 'Inference failed';
    case errorNetworkUnavailable:
      return 'Network unavailable';
    case errorDownloadFailed:
      return 'Download failed';
    case errorTimeout:
      return 'Timeout';
    case errorFileNotFound:
      return 'File not found';
    case errorInsufficientMemory:
      return 'Insufficient memory';
    case errorNotSupported:
      return 'Not supported';
    case errorCancelled:
      return 'Cancelled';
    case errorModuleNotFound:
      return 'Module not found';
    case errorModuleAlreadyRegistered:
      return 'Module already registered';
    case errorServiceNotFound:
      return 'Service not found';
    case errorBackendNotFound:
      return 'Backend not found';
    case errorInvalidHandle:
      return 'Invalid handle';
    case errorNotImplemented:
      return 'Not implemented';
    case errorUnknown:
      return 'Unknown error';
    default:
      return 'Error (code: $code)';
  }
}