stablyai/orca · error · Error

${label} is required

Error message

${label} is required

What it means

Thrown by validateRequiredString, a generic IPC input validator. It checks that a value is a non-empty string after trimming. Used across multiple fs: IPC handlers to guard required parameters (filePath, connectionId, suggestedName, transferId, contentBase64) before any filesystem operation. The label identifies which parameter was missing.

Source

Thrown at src/main/ipc/filesystem.ts:205

    }
    if (isBinaryBuffer(buffer)) {
      return { content: '', isBinary: true }
    }
    return {
      content: buffer.toString('utf8'),
      isBinary: false,
      fileIdentity: localLogFileIdentity(stats)
    }
  } finally {
    await handle.close()
  }
}

type DownloadFileResult = { canceled: true } | { canceled: false; destinationPath: string }

function validateRequiredString(value: unknown, label: string): string {
  if (typeof value !== 'string' || value.trim() === '') {
    throw new Error(`${label} is required`)
  }
  return value
}

function decodeDownloadedFileContent(content: string, encoding: 'utf8' | 'base64'): Buffer {
  if (encoding === 'base64') {
    return Buffer.from(content, 'base64')
  }
  return Buffer.from(content, 'utf8')
}

type DownloadSession = {
  destinationPath: string
  tempPath: string
  destinationExisted: boolean
  handle: FileHandle
  cleanupTimer: ReturnType<typeof setTimeout>
  senderId: number

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Validate the parameter in the renderer before calling ipcRenderer.invoke: ensure it is a non-empty string.
  2. Add UI guards: disable the action button until the required field is filled.
  3. Check for null/undefined from upstream state before constructing the IPC args object.

Example fix

// before:
//   ipcRenderer.invoke('fs:downloadFile', { filePath: selectedPath, connectionId: undefined })
// after:
//   if (!connectionId) throw new Error('Select an SSH connection first')
//   ipcRenderer.invoke('fs:downloadFile', { filePath: selectedPath, connectionId })
Defensive patterns

Strategy: type-guard

Validate before calling

function assertRequiredString(value: unknown, label: string): string {
  if (typeof value !== 'string' || value.trim() === '') {
    throw new Error(`${label} is required`)
  }
  return value
}

// Before calling IPC:
// const filePath = assertRequiredString(selectedPath, 'filePath')
// const connectionId = assertRequiredString(activeConnection?.id, 'connectionId')
// ipcRenderer.invoke('fs:downloadFile', { filePath, connectionId })

Type guard

function isNonEmptyString(value: unknown): value is string {
  return typeof value === 'string' && value.trim() !== ''
}

// Usage:
// if (!isNonEmptyString(args?.filePath)) { throw new Error('filePath is required') }
// if (!isNonEmptyString(args?.connectionId)) { throw new Error('connectionId is required') }

Try / catch

try {
  await ipcRenderer.invoke('fs:downloadFile', args)
} catch (error) {
  if (error instanceof Error && error.message.endsWith(' is required')) {
    // programming error in renderer — fix the call site
    console.error('Missing required IPC argument:', error.message)
    return
  }
  throw error
}

Prevention

When it happens

Trigger: Calling any fs: IPC handler (downloadFile, saveDownloadedFile, etc.) with an undefined, null, non-string, or whitespace-only value for a required parameter. The check runs before authorization or filesystem access.

Common situations: Renderer code passes undefined or an empty string because the upstream state was not populated. A user cancels a dialog and the code fails to short-circuit before invoking the IPC. A serialization issue drops the parameter value. Calling downloadFile without a connectionId when the SSH connection has not been established.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/99078df281b04a74. Report an issue: GitHub.