Skip to content

Commit

Permalink
🐛 fix: handling unknown error
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Dec 14, 2023
1 parent 8447161 commit e503d1f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ export const createGatewayOnNodeRuntime = (options: NodeRuntimeGatewayOptions =
console.error(error);
const { errorType, body } = error as GatewayErrorResponse;

res.status(getPluginErrorStatus(errorType)).send(errorType ? { body, errorType } : error);
res
.status(getPluginErrorStatus(errorType))
.send(
errorType
? { body, errorType }
: { body: error, errorType: PluginErrorType.PluginGatewayError },
);
}
};
};

0 comments on commit e503d1f

Please sign in to comment.