Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

462 B
Raw Blame
import { isEffectivelyOffline } from '../sync/networkMode';

/**
 * What an online-only repository call answers while there is no connection:
 * nothing read or written, and the view says why instead of a failure.
 */
export class OnlineOnlyError extends Error {
  constructor() {
    super('This needs a connection');
    this.name = 'OnlineOnlyError';
  }
}

export function requireOnline(): void {
  if (isEffectivelyOffline()) throw new OnlineOnlyError();
}