mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-08-02 14:01:59 +08:00
chore: update request error message
This commit is contained in:
@ -15,8 +15,11 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
const connector = newConnector(connection);
|
||||
await connector.testConnection();
|
||||
res.status(200).json({});
|
||||
} catch (error) {
|
||||
res.status(400).json({});
|
||||
} catch (error: any) {
|
||||
res.status(400).json({
|
||||
message: error.message || "Failed to test connection.",
|
||||
code: error.code || "UNKNOWN",
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user