npm package diff
Package: @forge/sql
Versions: 2.2.0 - 2.2.1-next.0
File: package/out/errors.js
Index: package/out/errors.js
===================================================================
--- package/out/errors.js
+++ package/out/errors.js
@@ -1,42 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-exports.MigrationCheckPointError = exports.MigrationExecutionError = exports.ForgeSQLAPIError = exports.ForgeSQLAPIUnknownError = exports.ForgeSQLError = void 0;
+exports.MigrationCheckPointError = exports.MigrationExecutionError = exports.ForgeSQLAPIError = exports.ForgeSQLError = void 0;
class ForgeSQLError extends Error {
constructor(message) {
super(message);
this.name = 'ForgeSQLError';
}
}
exports.ForgeSQLError = ForgeSQLError;
-class ForgeSQLAPIUnknownError extends ForgeSQLError {
- code = 'UNKNOWN_ERROR';
- responseText;
- status;
- statusText;
- traceId;
- constructor(responseDetails, body, message) {
- super(message || 'Unexpected error in Forge SQL API request');
- this.code = 'UNKNOWN_ERROR';
- this.status = responseDetails.status;
- this.statusText = responseDetails.statusText;
- this.traceId = responseDetails.traceId;
- this.responseText = body;
- }
-}
-exports.ForgeSQLAPIUnknownError = ForgeSQLAPIUnknownError;
-class ForgeSQLAPIError extends ForgeSQLAPIUnknownError {
+class ForgeSQLAPIError extends ForgeSQLError {
+ responseDetails;
code;
- serverMessage;
+ message;
suggestion;
context;
- constructor(responseDetails, forgeError, message) {
- super(responseDetails, undefined, message || forgeError.message);
- const { code, message: serverMessage, suggestion, context = {}, ...additionalData } = forgeError;
+ constructor(responseDetails, forgeError) {
+ super(forgeError.message);
+ const { status, statusText, traceId } = responseDetails;
+ this.responseDetails = { status, statusText, traceId };
+ const { code, message, suggestion, context = {}, ...bodyData } = forgeError;
this.code = code;
- this.serverMessage = serverMessage;
+ this.message = message;
this.suggestion = suggestion;
- this.context = { ...context, ...additionalData };
+ this.context = { ...context, ...bodyData };
}
}
exports.ForgeSQLAPIError = ForgeSQLAPIError;
class MigrationExecutionError extends ForgeSQLError {