@prisma/adapter-mssql 6.14.0-dev.4 → 6.14.0-dev.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -148,9 +148,16 @@ function mapRow(row, columns) {
148
148
 
149
149
  // src/errors.ts
150
150
  function convertDriverError(error) {
151
- if (!isDbError(error)) {
152
- throw error;
151
+ if (isDriverError(error)) {
152
+ return {
153
+ originalCode: error.code,
154
+ originalMessage: error.message,
155
+ ...mapDriverError(error)
156
+ };
153
157
  }
158
+ throw error;
159
+ }
160
+ function mapDriverError(error) {
154
161
  switch (error.number) {
155
162
  case 3902:
156
163
  case 3903:
@@ -319,7 +326,7 @@ function convertDriverError(error) {
319
326
  };
320
327
  }
321
328
  }
322
- function isDbError(error) {
329
+ function isDriverError(error) {
323
330
  return typeof error.message === "string" && typeof error.code === "string" && typeof error.number === "number";
324
331
  }
325
332
 
package/dist/index.mjs CHANGED
@@ -115,9 +115,16 @@ function mapRow(row, columns) {
115
115
 
116
116
  // src/errors.ts
117
117
  function convertDriverError(error) {
118
- if (!isDbError(error)) {
119
- throw error;
118
+ if (isDriverError(error)) {
119
+ return {
120
+ originalCode: error.code,
121
+ originalMessage: error.message,
122
+ ...mapDriverError(error)
123
+ };
120
124
  }
125
+ throw error;
126
+ }
127
+ function mapDriverError(error) {
121
128
  switch (error.number) {
122
129
  case 3902:
123
130
  case 3903:
@@ -286,7 +293,7 @@ function convertDriverError(error) {
286
293
  };
287
294
  }
288
295
  }
289
- function isDbError(error) {
296
+ function isDriverError(error) {
290
297
  return typeof error.message === "string" && typeof error.code === "string" && typeof error.number === "number";
291
298
  }
292
299
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/adapter-mssql",
3
- "version": "6.14.0-dev.4",
3
+ "version": "6.14.0-dev.41",
4
4
  "description": "Prisma's driver adapter for \"mssql\"",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "mssql": "^11.0.1",
35
35
  "async-mutex": "0.5.0",
36
- "@prisma/driver-adapter-utils": "6.14.0-dev.4"
36
+ "@prisma/driver-adapter-utils": "6.14.0-dev.41"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/mssql": "9.1.7",