Skip to content

Commit

Permalink
forcefully trigger a crash if an error occured
Browse files Browse the repository at this point in the history
  • Loading branch information
o0Ignition0o committed Jul 22, 2024
1 parent 1cd7add commit a64ccd8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions router-bridge/js-src/plan_worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,13 @@ async function run() {
// there won't be any messageId to send a payload back to the router,
// unless we keep it in this scope.
let messageId;
let payload;
try {
messageId = "";
payload = "";
const { id, payload: event } = await receive();
messageId = id;
payload = event;
try {
switch (event?.kind) {
case PlannerEventKind.UpdateSchema:
Expand Down Expand Up @@ -329,6 +332,15 @@ async function run() {
}
} catch (e) {
logger.warn(`plan_worker: an unknown error occurred ${e}\n`);
const schemaId = (payload as PlannerEvent).schemaId;
print(`plan_worker: an unknown error occurred ${e}\n${JSON.stringify(
payload
)}\n
schemaID:\n
${schemaId}\n
schema:\n
${planners.get(schemaId).schemaString}
`);

const unexpectedError = {
name: e.name || "unknown",
Expand Down

0 comments on commit a64ccd8

Please sign in to comment.