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 [];
}
}
Reads the current ring buffer from session storage, tolerating a missing or malformed value by returning an empty list.