ChemPal Documentation - v1.7.0
    Preparing search index...

    Function getRecentErrors

    • Reads the current ring buffer from session storage, tolerating a missing or malformed value by returning an empty list.

      Returns Promise<CapturedError[]>

      The stored exceptions, oldest first.

      const errors = await getRecentErrors();
      errors.length; // 0..MAX_ERRORS
      export async function getRecentErrors(): Promise<CapturedError[]> {
      try {
      const stored = await cstorage.session.get(STORAGE_KEY);
      const value: unknown = stored[STORAGE_KEY];
      return Array.isArray(value) ? value : [];
      } catch {
      return [];
      }
      }