Display errors

This commit is contained in:
Adria Navarro 2023-06-27 09:25:46 +01:00
parent b075f4db1b
commit c9bee9e423
1 changed files with 11 additions and 3 deletions

View File

@ -151,9 +151,17 @@ class SqlServerIntegration extends Sql implements DatasourcePlus {
async connect() { async connect() {
try { try {
this.client = await this.pool.connect() this.client = await this.pool.connect()
} catch (err) { } catch (err: any) {
// @ts-ignore if (err?.originalError?.errors?.length) {
throw new Error(err) const messages = []
if (err.message) {
messages.push(err.message)
}
messages.push(...err.originalError.errors.map((e: any) => e.message))
throw new Error(messages.join("\n"))
}
throw err
} }
} }