@bluemarble/bm-components 1.9.4 → 1.10.0

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.mjs CHANGED
@@ -4010,6 +4010,15 @@ var HttpError = class extends Error {
4010
4010
  }
4011
4011
  };
4012
4012
 
4013
+ // src/errors/DomainError.ts
4014
+ var DomainError = class extends Error {
4015
+ constructor(message) {
4016
+ super(message);
4017
+ this.message = message;
4018
+ this.stack = `DomainError: ${message}`;
4019
+ }
4020
+ };
4021
+
4013
4022
  // src/helpers/apiHelper/index.ts
4014
4023
  var VALID_METHODS = [
4015
4024
  "GET",
@@ -4058,6 +4067,8 @@ var ApiHelper = class _ApiHelper {
4058
4067
  );
4059
4068
  yield methodWithMiddlewares(req, res);
4060
4069
  } catch (error) {
4070
+ if (error instanceof DomainError)
4071
+ return res.status(400).json(error.message);
4061
4072
  if (error instanceof HttpError)
4062
4073
  return res.status(error.status).json(error.message);
4063
4074
  if (process.env.NODE_ENV === "production") {
@@ -5126,6 +5137,7 @@ export {
5126
5137
  Checkbox,
5127
5138
  CreateAuthProvider,
5128
5139
  Dialog,
5140
+ DomainError,
5129
5141
  EditableTableCell,
5130
5142
  FormHelperContext,
5131
5143
  FormHelperProvider,