Add page data delivery and publication guards
This commit is contained in:
@@ -47,6 +47,7 @@ export async function consumeSessionEventsUntilFinish(
|
||||
if (Date.now() > deadline) {
|
||||
const err = new Error(`session reply timed out after ${timeoutMs}ms`);
|
||||
err.code = 'SESSION_REPLY_TIMEOUT';
|
||||
err.retryable = false;
|
||||
throw err;
|
||||
}
|
||||
|
||||
@@ -63,6 +64,7 @@ export async function consumeSessionEventsUntilFinish(
|
||||
if (event.type === 'Error') {
|
||||
const err = new Error(String(event.error ?? 'session reply failed'));
|
||||
err.code = 'SESSION_REPLY_ERROR';
|
||||
err.retryable = false;
|
||||
throw err;
|
||||
}
|
||||
if (event.type === 'Finish') {
|
||||
@@ -76,5 +78,6 @@ export async function consumeSessionEventsUntilFinish(
|
||||
|
||||
const err = new Error('session event stream ended before Finish');
|
||||
err.code = 'SESSION_REPLY_INCOMPLETE';
|
||||
err.retryable = false;
|
||||
throw err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user